4 ms·
GraphQL lets you represent your API as a graph. You do this by defining a set of types that have fields in them which resolve to instances of other types. For
by tiglionabbit 11y ago
GraphQL lets you represent your API as a graph. You do this by defining a set of types that have fields in them which resolve to instances of other types. For example, if you have a "Person" type with a "friends" field that resolves to more people, you could traverse this as deeply as you wanted, like so:
query { me { friends { friends { friends { friends { name } } } } } }
That would get you the names of my friends of friends of friends of friends. It's a directed graph where you can traverse as many edges as you want in any direction in a single query. It's like a power tools version of your usual REST API.
What more are you expecting?
(in relay this would look a bit different due to the "connection" spec, but you're free to define a graphql endpoint this way too)