-
Hi folks! Can somebody please tell me how to return the schema in json so that I can config the graphql codgen from frontend to use the url from go server. I'm pretty new to go. Thanks in advanced! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can use integration testing package as an example of how to achieve this. Codegen configuration points to the graphql endpoint where it would perform introspection Here you can see the command that generates the code The graphql code generator is scanning src/**/*.graphql for your queries, mutations and subscriptions |
Beta Was this translation helpful? Give feedback.
-
@khuongtp Did you ever get this to work? I'm trying to do the same thing and I'm having trouble. |
Beta Was this translation helpful? Give feedback.
You can use integration testing package as an example of how to achieve this.
https://github.com/99designs/gqlgen/tree/master/integration
Codegen configuration points to the graphql endpoint where it would perform introspection
https://github.com/99designs/gqlgen/blob/master/integration/codegen.ts
Here you can see the command that generates the code
npm run gen
https://github.com/99designs/gqlgen/blob/master/integration/package.json#L8
The graphql code generator is scanning src/**/*.graphql for your queries, mutations and subscriptions