feat(c/v3-engine): support Relay's `Cursor Connections Specification`
Component
c/v3-engine
Is your proposal related to a problem?
There's GraphQL Cursor Connections Specification for Relay.
Hasura v2 supports it.
Hasura v3 ddn docs argue it also supports the spec.
But I actually cannot find a way to enable it.
Describe the solution you'd like
Metadata setting for Relay's Cursor-Connection Spec.
Describe alternatives you've considered
Additional APIs (e.g. connection suffix as like v2)
@jjangga0214 — can you take a look at the collapsed example inside of this docs section and let me know if this helps you use GlobalIDs for relay?
DDN calls this global id
This needs to be configured on the Model https://hasura.io/docs/3.0/supergraph-modeling/models
kind: Model
version: v1
definition:
globalIdSource: true
And also on the ObjectType https://hasura.io/docs/3.0/supergraph-modeling/types/
kind: ObjectType
version: v1
definition:
globalIdFields:
- author_id
This should enable the relay global id on this model
@robertjdominguez Hi! Thanks for the reply :)
@nullxone Thanks for the advice :)
I've already configured Global ID, but that's not the point.
Opaque Global ID, Node interface, and node query are just part of Relay spec.
I am asking for another one. About GraphQL Cursor Connections Specification.
For example, the screenshot below is from Hasura v2.
As you can see, there are pageInfo, edges, cursor, node ..
v2 supports them while v3 doesn't.
To declare "ddn supports Relay spec", GraphQL Cursor Connections Specification must be supported as well.
Without Cursor Connections Spec, directives like @connection, which is used for Relay Client implementation, will take no effect.
Thanks for clarifying, @jjangga0214 🙌
I've updated the docs to accurately reflect what we support with respect to Relay and have added the c/v3-engine tag to this issue.
This tag will trigger an internal automation so we can track this and get back to you with information about the feature request. Let us know if you have any questions!