Additional fields on Relay connection plugin global config
See original GitHub issueHi all,
There is a potential bug for additional extended fields (e.g.: totalCount
) added globally on the on the Relay connection plugin when there’s a nested connection of the same type as the parent. I’ve created a small repo that reproduces the behavior: https://github.com/oliveiraethales/nexus-nested-totalcount-bug
It seems that configuring the totalCount
in a one-off/per-field instead of in the global configuration of the plugin works properly; and the resulting schema is also different when doing so.
Any thoughts?
Thank you!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Relay Connection - Plugins - GraphQL Nexus
The connection plugin provides a new method on the object definition builder, enabling paginated associations between types, following the Relay Connection ...
Read more >Relay plugin for Pothos GraphQL
The relay plugin adds to new query fields node and nodes which can be used to directly fetch nodes using global IDs by...
Read more >Relay Compiler - Relay Docs
Relay Modern uses the Relay Compiler to convert graphql literals into generated files that live alongside your source files. While you type queries...
Read more >Building a Relay-Compliant Schema With Node/Express
Maybe you found dated examples of the proper compliant setup. Maybe you keep finding articles on the frontend side of Relay when you're ......
Read more >Using with Relay — absinthe v1.7.0 - HexDocs
Relay expects you to provide a query field called node that accepts a global ID (as arg :id ) and returns the corresponding...
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
FWIW I got bitten with these changes moving from
1.0.0
to1.1.0
with our extended connections with atotalCount
field.Documentation is not altogether clear and release notes don’t appear to clearly indicate this as a possibly breaking change between versions.
Documentation at Extending Connection / Edge types shows only the
nodes
version for a globally configured extension.A use case where the connection is extended globally but provided by the
resolve
approach is not shown.ie. it would require something like:
@edufelipe - just looked at the code, currently, if you use the
resolve
syntax then you need to specify thetotalCount
on the object returned:If you use the
nodes
return, then thetotalCount
fn gets called:At some point I’ll look into whether it makes sense to change this behavior, but just wanted to give you an idea of how it works for now.