paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers
https://paljs.com
MIT License
684 stars 54 forks source link

Is UUID supported with the nexus tools? #118

Closed willwillis closed 4 years ago

willwillis commented 4 years ago

I get the following error when attempting to yarn dev


C:\Users\\code\prisma\prisma2-0707-relations\paljs-apollo-nexus-schema2\node_modules\@nexus\schema\src\utils.ts:360
    throw new Error("\n" + errors);
          ^
Error:
- Missing type UUID, did you forget to import a type to the root query?
    at Object.assertNoMissingTypes (C:\Users\\code\prisma\prisma2-0707-relations\paljs-apollo-nexus-schema2\node_modules\@nexus\schema\src\utils.ts:360:11)
    at Object.makeSchema (C:\Users\\code\prisma\prisma2-0707-relations\paljs-apollo-nexus-schema2\node_modules\@nexus\schema\src\builder.ts:1670:3)
    at Object.<anonymous> (C:\Users\\code\prisma\prisma2-0707-relations\paljs-apollo-nexus-schema2\src\nexusSchema.ts:5:23)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Module.m._compile (C:\Users\\code\prisma\prisma2-0707-relations\paljs-apollo-nexus-schema2\node_modules\ts-node\src\index.ts:858:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Object.require.extensions.<computed> [as .ts] (C:\Users\\code\prisma\prisma2-0707-relations\paljs-apollo-nexus-schema2\node_modules\ts-node\src\index.ts:861:12)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
AhmedElywa commented 4 years ago

We just add DateTime any other custom types you need to add manually can you share where you use this type, please?

willwillis commented 4 years ago

I use it as an ID field, as documented here: https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-schema/data-model#single-field-ids-with-default-values

AhmedElywa commented 4 years ago

But it's reading as String

AhmedElywa commented 4 years ago

@willwillis you can add UUID manually https://github.com/olistic/graphql-type-uuid