feat: new operations-document plugin to generate a GraphQL Document with operations from schema - #6861
feat: new operations-document plugin to generate a GraphQL Document with operations from schema#6861ardatan wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: 320eecb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/theguild/graphql-code-generator/HRqNze9Akk4B67RwksY3njzYwwz9 [Deployment for 320eecb failed] |
|
The latest changes of this PR are available as alpha in npm (based on the declared |
1a4493a to
ff30197
Compare
9ea19ea to
7673256
Compare
charlypoly
left a comment
There was a problem hiding this comment.
what would be the use-case of this plugin?
I feel it's kind of breaking the design goal of GraphQL by adding all available fields to all operations.
Operations should be built depending on the use-case, otherwise, we're back to good old REST "fetch everything" scenario.
Any thoughts?
|
Not being @ardatan , but having exactly this requirement. |
|
I agree with @charlypoly, we should not support this. Aside from this, I see many weird issues e.g. How would the plugin choose the value of a mandatory field argument? @taffit your overhead could be reduced by using fragments. |
|
It is perfectly fine in my opinion. We have app, where we don't care any data from mutation (we request id only all the time) so this would be great. |
... that you have to write yourself. And maintain and adjust, if something changes. This is what I'm doing currently. |
|
any chance we can get this to generate a file per query / mutation? |
|
Feel free to create a PR based on this branch, I'd love to merge them into this one. |
|
should we maybe just recommend people to use https://github.com/timqian/gql-generator ? |
|
@Urigo The only issue with recommending people to use https://github.com/timqian/gql-generator Is this "feature" that creates invalid output schema- That one plagued me for a few hours while I tried to figure out why the documents were not correct |
|
Hope this get merged. This is definitely useful for testing at least. |
|
this would be nice to have |
|
Is it going to be merged? |
No description provided.