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

Fix type of cursor argument in PaginationContainer example #1733

Closed
wants to merge 1 commit into from
Closed

Fix type of cursor argument in PaginationContainer example #1733

wants to merge 1 commit into from

Conversation

coleturner
Copy link
Contributor

@coleturner coleturner commented May 7, 2017

According to the GraphQL Connection documentation, the implied default type of cursor argument is String:
https://facebook.github.io/relay/graphql/connections.htm#sec-Cursor

While other types are possible, I think it might be best to default to String as most implementations default to String type and it would greatly help newcomers who likely are using these implementations.

Otherwise, many will encounter the following error:
Variable "$cursor" of type "ID" used in position expecting type "String".

See implementations where String type is implemented as default:
GraphQL Ruby
GraphQL Relay JS
GraphQL Python
Sangria GrapHQL for Scala

According to the GraphQL Connection documentation, the `cursor` argument should be a `String` type instead of `ID`:
https://facebook.github.io/relay/graphql/connections.htm#sec-Cursor

This fixes errors that arise from using the example as inspiration such as:
`Variable "$cursor" of type "ID" used in position expecting type "String".`
@facebook-github-bot
Copy link
Contributor

@kassens has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@kassens
Copy link
Member

kassens commented May 7, 2017

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants