TS libraries for GQL queries can dynamically infer the response shape from the shape of the selected fields.
Such that the query
query { user { username posts { text } } }
type Response = { user: { username: string posts: Array<{ text: string }> } }
TS libraries for GQL queries can dynamically infer the response shape from the shape of the selected fields.
Such that the query
Would be And a query with just { user { username } } would have the posts property omitted entirely.