Skip to content

Can you autogenerate fragments for you base model? #9914

Discussion options

You must be logged in to vote

Is there a reason why new fields should be automatically fetched? GraphQL's default mode of operation is "fetch data when you need it". Adding new field/s when they are available in the schema can easily lead to over-fetching (unless I misunderstood the use cases here).

If this feature is implemented into the core plugins, I can see these follow-up requirements (could be complicated to implement, but doesn't help with the default mode of operation):

  • Must avoid nested types
  • Option to avoid adding some fields to the fragment

Most likely this will not be implemented into the core plugins, but feel free to create your own plugin to suit your use cases 🙂

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@PaulRBerg
Comment options

@eddeee888
Comment options

@PaulRBerg
Comment options

@eddeee888
Comment options

Answer selected by eddeee888
@PaulRBerg
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants