We heavily use GraphQL with Retool and I am hoping to see a feature of GraphQL utilized in Retool. This feature is the use of Fragments. For clarification, a fragment can be defined as:
A GraphQL fragment is a piece of logic that can be shared between multiple queries and mutations .
Some of our larger Retool apps may have 15 or more GraphQL queries and mutations. Often these queries have a shared set of fields which are returned from them. On multiple occasions I've noticed that a field may be missing from one or more queries or mutations causing an error or missing data. If a shared fragment could be defined, that fragment could be used between the different queries and mutations. I guess it would have to be it's own GraphQL resource type and referenced by other GraphQL resource types.
Honestly as I thought about that I almost deleted this post, but decided to keep it just in case someone else thinks could be useful and could think through an implementation of it. I guess things get complicated on the Retool side referencing the other resources, and probably the need for more than one resource (it's not uncommon to reference many fragments in a large query).
The way this is managed now is copy and pasting between all the different queries to ensure the same set of fields are being referenced between them.