Relay - adding fields to Connection and Edge types
See original GitHub issueI have a question regarding Relay protocol. I would like to add some fields (for example totalCount
) to some Connection Types. Something similar to GitHub’s API at https://developer.github.com/v4/explorer/.
I found that this is explicitly allowed by Relay Cursor Connections Specification (2.1 and 3.1).
I implemented io.leangen.graphql.execution.relay.Page<N>
interface and added public long getTotalCount()
method but it didn’t show up in introspection query result.
Is it currently possible to somehow add fields to Connection and Edge types? Or could this be added to graphql-spqr?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Rendering Connections - Relay
Relay guide to rendering connections. ... Specifically, we can query the edges and node s in the connection; the edges usually contain information...
Read more >Explaining GraphQL Connections - Apollo GraphQL Blog
It seems like people resist adding fields to their edge type because most tools treat the edge type as boilerplate, including graphql-relay-js ...
Read more >Relay Connection - Plugins - GraphQL Nexus
It provides simple ways to customize fields available on the Connection , Edges , or PageInfo types. To install, add the connectionPlugin to...
Read more >Relay/GraphQL add custom field to connection - Stack Overflow
connectionArgs, isbn: { type: GraphQLString }, publisher: {type: GraphQLString}}, ... Above is the graphql-relay lib that has this function.
Read more >Learn more about Connections, Edges & Nodes in Relay
Relay introduces a handful of new concepts on top of GraphQL, ... The actors field is a connection between a movie and multiple...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I tried to extend page and it works well. Thank you.
I’ll look into adding this in the following days unless you end up implementing it earlier 😃