Skip to content

Error if 'first' or 'last' is negative for a Relay connection argument#840

Merged
bbakerman merged 1 commit into
graphql-java:masterfrom
RusticFlare:validate-relay-connection-args
Nov 28, 2017
Merged

Error if 'first' or 'last' is negative for a Relay connection argument#840
bbakerman merged 1 commit into
graphql-java:masterfrom
RusticFlare:validate-relay-connection-args

Conversation

@RusticFlare

Copy link
Copy Markdown
Contributor

Problem

graphql.relay.SimpleListConnection does not give an error if either the first or last argument is negative.

Solution

Throw an exception if the value of either the first or last argument is negative.


Extra Details

The Relay Cursor Connections Specification section on the Pagination Algorithm says:

If first is less than 0: Throw an error

and

If last is less than 0: Throw an error

@bbakerman bbakerman merged commit dc57aa2 into graphql-java:master Nov 28, 2017
@RusticFlare RusticFlare deleted the validate-relay-connection-args branch September 5, 2018 10:48
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

Successfully merging this pull request may close these issues.

2 participants