LMSouq
moodle-core Open

What is the reason for having edges and nodes in a connection in your graphql schema?

CO
Community Contributor
1 month ago
3 views
Problem Description
I am trying to understand more complex graphql apis that implement the [Relay Cursor Connections Specification][1] If you look at the query below that I run on the [github graphql api explorer][2] { repository(owner: "getsmarter", name: "moodle-api") { id issues(first:2 ) { edges { node { id body } } nodes { body } pageInfo { endCursor hasNextPage hasPreviousPage startCursor } totalCount } } } Notice it has the fields **edges** and **nodes**. Why does github have an additional field called nodes in their api? Why don’t they just use the edges field since you can get the same data from edges? Is this just for convenience? [1]: https://facebook.github.io/relay/graphql/connections.htm [2]: https://developer.github.com/early-access/graphql/explorer/

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base