I'm new to GraphQL so please forgive any if this is a silly question.
I want to organize GraphQL files(schema and query/mutation files) in client side, which has to be aligned with the GraphQL files on server.
What is the good practice for this purpose? Is there any tool/toolchain/service, or do we have to maintain those manually(i.e. if a schema get changed on server or client, the counterpart in response update the corresponding schema)?
It would be nice if I can just use automatically-synched .graphql file which has no conflict with the ones in server.
A recommended approach to achieve this is by utilizing GraphQL Code Generator, a CLI tool for generating code from your GraphQL schema. If you are working with a monorepo that includes both front-end and back-end code, you can follow these steps:
You can also refer to an older question here on StackOverflow that discusses a similar issue.