Can you autogenerate fragments for you base model? #9914
              
                
                  
                  
                    Answered
                  
                  by
                    eddeee888
                  
              
          
                  
                    
                      brentshulman-silkline
                    
                  
                
                  asked this question in
                General
              
            -
| 
         Ex: if I have a GQL model with a few fields, can I get it to autogenerate a fragment with all the fields? It would make querying, in some cases, easier.  | 
  
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            eddeee888
          
      
      
        Jun 1, 2025 
      
    
    Replies: 2 comments 5 replies
-
| 
         Auto-generating fragments would be super helpful! Can one of the contributors please comment here?  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            -
| 
         Hello 👋  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    5 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
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):
Most likely this will not be implemented into the core plugins, but feel free to create your own plugin to suit your use cases 🙂