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

Error when fetching past end of Launches #91

Open
gschmidt opened this issue Jul 14, 2019 · 0 comments
Open

Error when fetching past end of Launches #91

gschmidt opened this issue Jul 14, 2019 · 0 comments

Comments

@gschmidt
Copy link

gschmidt commented Jul 14, 2019

Cursor is defined as non-nullable:

type LaunchConnection { # add this below the Query type as an additional type.
  cursor: String!
  hasMore: Boolean!
  launches: [Launch]!
}

But if no launches are retrieved (for example if you pass in a cursor for which hasMore was false), then the code will carefully return null for the cursor:

      return {
        launches,
        cursor: launches.length ? launches[launches.length - 1].cursor : null,

Resulting in INTERNAL_SERVER_ERROR:
Screen Shot 2019-07-13 at 8 22 12 PM

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