<@U646LFACQ> (or anyone else here who knows), seem...
# orm-help
r
@divyendu (or anyone else here who knows), seems the npm project
graphql-resolver-codegen
is now called
graphqlgen
(https://github.com/prisma/graphqlgen). im following an example project (https://github.com/prisma/graphql-prisma-typescript) which still references
graphql-resolver-codegen
and has some interface codegen scripts (https://github.com/prisma/graphql-prisma-typescript/blob/master/package.json#L12).. what would the equivalent of that be in the
graphqlgen
world?
q
Maybe one of the examples here helps: https://github.com/prisma/prisma-examples/tree/master/typescript-graphql-auth-advanced this one is using graphqlgen
equivalent would be the graphqlgen.yml config file
r
I’ve noticed that in some online examples, there is a import comment at the top of
schema.graphql
and in some there isn’t. ie,
Copy code
# import {} from "./generated/prisma-client/prisma.graphql"
what is the right way to go about this? why sometimes imported and sometimes not
t
Additional question. How can you import schema after typescript generation? Or is it is highly discouraged according to the documentation you have provided @qirex? I see some of the use-cases when I should be able to just pass through information from database without redefining the types.
q
Quoting from the docs:
You typically don't redefine your model definitions in the application schema. Instead, you import them using graphql-import:
you can generate graphql (use case as quoted) and typescript types to import in your server application.
t
I understand that. Question is: typescript-generate only creates
prisma-schema.ts
, where types reside, which cannot be imported directly into application
schema.graphql
. Or am I missing something? Should I use two generators then?
q
Cant give you an 'official best practice' answer here. I'am using both generators in my project like this: in file prisma.yml
Copy code
generate:
  - generator: graphql-schema
    output: ../src/generated/schema/
  - generator: typescript-client
    output:  ../src/generated/prisma-client/
t
I thought so. Thanks.