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

Relay and Federated API #416

Open
blongstreth opened this issue Dec 19, 2021 · 0 comments
Open

Relay and Federated API #416

blongstreth opened this issue Dec 19, 2021 · 0 comments

Comments

@blongstreth
Copy link

blongstreth commented Dec 19, 2021

I am evaluating this library for use in a federated GraphQL API and noticed that I can't easily federate with other services which have defined the relay cursor as a scalar type rather than a string. For example:

scalar Cursor

type PageInfo {
  endCursor: Cursor
  hasNextPage: Boolean!
  hasPreviousPage: Boolean!
  startCursor: Cursor
}

type FooConnection {
  edges: [FooEdge!]!
  pageInfo: PageInfo!
  totalCount: Int!
}

type FooEdge {
  cursor: Cursor!
  node: Foo!
}

type Foo {

}

type Query {
  getFooElements(after: Cursor, before: Cursor, first: Int, last: Int): FooConnection!
}

I briefly looked through graphgl-java Relay class and noticed that doesn't lend itself to easily support a scalar Cursor type or even a custom PageInfo type name (i.e. MyPageInfo) which would help get around the issue entirely. I don't see any easy way to hack around this issue without creating a custom connection-like API which doesn't extend Connection. I was just curious if anyone has any advise or would consider updating this library (and probably graphql-java to be consistent) to better support the scenario I just outlined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant