question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Relay - adding fields to Connection and Edge types

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
vojtechhabartacommented, Feb 9, 2018

I tried to extend page and it works well. Thank you.

1reaction
kaqqaocommented, Jan 2, 2018

I’ll look into adding this in the following days unless you end up implementing it earlier 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found