timqian / gql-generator

Generate queries from graphql schema, used for writing api test.
MIT License
375 stars 93 forks source link

Enable to use custom Query/Mutation/Subscription naming #54

Closed justenau closed 2 years ago

justenau commented 2 years ago

This PR solves https://github.com/timqian/gql-generator/issues/27.

During development we also run into issue that our queries and mutations are named RootQuery and RootMutation (which is by the way a very common practice) and this prevents us to use this tool. Renaming them is not an option since the types generated from them are used across many other projects and we can't change them.

I tested these changes with our schema and it works great. Also it's a small, non-breaking change that would solve quite a huge issue so I hope this will become part of the library soon, otherwise the only way to use it is to fork it to our project and add those changes there.

Will be waiting for updates, thanks! 🤞

timqian commented 2 years ago

👍👍