Yamashou / gqlgenc

This is Go library for building GraphQL client with gqlgen
MIT License
370 stars 66 forks source link

Support for graphql schema files (.graphqls) #86

Open krissell opened 3 years ago

krissell commented 3 years ago

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

Yamashou commented 3 years ago

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.

krissell commented 3 years ago

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.