gqlgenc icon indicating copy to clipboard operation
gqlgenc copied to clipboard

Support for graphql schema files (.graphqls)

Open krissell opened this issue 3 years ago • 2 comments

Hi, I have schema (.graphqls) files, like gqlgen uses here: https://gqlgen.com/getting-started/#define-your-schema This is different from this project's example *.graphql files.

When I generate the client (either via the command line or within the gqlgen server via code), the generated go code does not contain the query or mutation methods. It does generate the structs for the queries and mutation, but no methods to invoke them, like the example generated code does. In other words, no Client receiver functions are generated

Are schema files (.graphqls) supported?

If the answer is no, how are you using the gql server and your client with a common schema?

Thank you

krissell avatar Oct 06 '21 21:10 krissell

Does that mean you want to use the ".graphqls" extension? I have never seen the .graphqls extension. I've seen .graphql or .gql

the generated go code does not contain the query or mutation methods.

Do you have a Query for your client?

Set the schema file Please show me the schema and query files.

Yamashou avatar Oct 07 '21 05:10 Yamashou

Hi, Thanks for the quick reply. Ignore that extension. I was wrong there. I think I see what's happening now: I was expecting a client function for each query and mutuation in the schema. Now I see that I must also create another graphql file and write actual queries & mutuations in order for the client functions to be created.

krissell avatar Oct 07 '21 13:10 krissell