add useGraphqlPrint & removeClientSpecificFields options to persisted… #9926
+276
−84
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… documents in client-preset
🚨 IMPORTANT: Please do not create a Pull Request without creating an issue first.
Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.
Description
Adds two options to trusted documents codegen:
DocumentNode
to string or to use the default: @graphql-tools/documents printExecutableGraphQLDocumentDocumentNode
I've added both to be backwards compatible with what is currently in place, thus not having a breaking change but open to suggestions.
It's related to below bug where using the @graphql-tools/documents print actually breaks our schema because it changes the order of fields within a mutation (where for us the order is actually important). This will allow us to fix it but if it is an actual bug which could affect more people it is probably better to change the printExecutable to graphql's print.
Related #9925
Type of change
Please delete options that are not relevant.
Screenshots/Sandbox (if appropriate/relevant):
Adding links to sandbox or providing screenshots can help us understand more about this PR and take action on it as appropriate
How Has This Been Tested?
yarn test packages/presets/client/tests/client-preset.spec.ts --watch
Added unit tests
Test Environment:
@graphql-codegen/...
: latestChecklist:
Further comments
First PR here so open to any and all comments, feedback etc.