Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(c/v3-engine): support Relay's Cursor Connections Specification #10639

Open
jjangga0214 opened this issue Dec 29, 2024 · 4 comments
Open
Labels
c/v3-engine V3 Metadata and Engine k/enhancement New feature or improve an existing feature

Comments

@jjangga0214
Copy link
Contributor

jjangga0214 commented Dec 29, 2024

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.

스크린샷 2024-12-30 오전 7 19 15

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 jjangga0214 added the k/enhancement New feature or improve an existing feature label Dec 29, 2024
@robertjdominguez
Copy link
Contributor

@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?

@nullxone
Copy link
Collaborator

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

@jjangga0214
Copy link
Contributor Author

jjangga0214 commented Dec 31, 2024

@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.

스크린샷 2024-12-31 오전 11 49 58

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.

@robertjdominguez robertjdominguez added the c/v3-engine V3 Metadata and Engine label Dec 31, 2024
@robertjdominguez
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/v3-engine V3 Metadata and Engine k/enhancement New feature or improve an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants