Re:Is GraphQL Still Relevant in an HTTP2 World?
by baddox on Wednesday November 06, 2019 @05:56PM
(#21468500)
GraphQL can support arbitrary numbers of fields and arbitrary nesting of relationships. You can do this:
{
hero {
name
friends {
name
friends {
name
}
}
}
}
But some clients might only need this:
{
hero {
name
}
}
This is a small example, but it's pretty clear that "always including all fields and nested relationships in every REST API response" is not a viable solution.
(GraphQL examples based on the schema used in the official documentation: https://graphql.org/learn/queries/)