GraphQL - Automatically generate leaf nodes #3666
Replies: 6 comments
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
I think this should be possible |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
Hahaaaa 😄 Let me give this one a go. I've been working with GraphQL plenty (via GatsbyJS) but may still need some advice with this. Any suggestions? |
Beta Was this translation helpful? Give feedback.
-
Example of how GraphiQL achieves this - https://github.com/graphql/graphiql/blob/5b9012ea0e74452787f6c793d68aaa2cb915731b/src/utility/fillLeafs.js#L73-L104 |
Beta Was this translation helpful? Give feedback.
-
Details
Hi there!
Back then someone asked for a feature in GraphQL to automatically generate leaf nodes when opening the query brackets, but the request got stale and closed.
As of today, is this feature still hard to be implemented? Insomnia's GraphQL already have a good intellisence, so I'm guessing it has all information needed to automatically generate all leaf nodes when openning the query bracket. Like GraphiQL, this feature should be activated as needed.
It is easier to generate all leaf nodes and delete the unwanted ones than to write each required node.
Edit: Would be good an option to set the level of children to generate. If set to 1, then only the direct children will be generated. If set to 2, then the children's children will be generated as well, and so on. For me 1 level is good enough.
Best regards,
Rafael Pacheco.
Beta Was this translation helpful? Give feedback.
All reactions