Get all the possible returned fields and types for query fields #381
Replies: 1 comment
-
I assume you want a TypeScript type for an object type? What you're basically asking for is impossible. GraphQL Object types have no canonical JSON shape. That's because any given object can have a variable set of fields selected, fields can be aliased, fragments can be interpolated (conditionally), and fields may receive arguments, which alter the result. Related threads: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to get the returned object from a query of the schema, not one I have created?
Use case: We need to create a function that will merge fields. To do so we need to handle all fields that the query can return
It would be great if there was a typescript type that contained these info.
Similar to
introspection_types
object but in typescriptBeta Was this translation helpful? Give feedback.
All reactions