Skip to content

Commit

Permalink
Added a description to the pagination arguments. (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed May 31, 2021
1 parent 3b0cbd0 commit 02a5a27
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
30 changes: 27 additions & 3 deletions src/connection/__tests__/connection-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,33 @@ describe('connectionDefinition()', () => {
type User {
name: String
friends(after: String, first: Int, before: String, last: Int): FriendConnection
friendsForward(after: String, first: Int): UserConnection
friendsBackward(before: String, last: Int): UserConnection
friends(
"""Returns the items in the list that come after the specified cursor."""
after: String
"""Returns the first n items from the list."""
first: Int
"""Returns the items in the list that come before the specified cursor."""
before: String
"""Returns the last n items from the list."""
last: Int
): FriendConnection
friendsForward(
"""Returns the items in the list that come after the specified cursor."""
after: String
"""Returns the first n items from the list."""
first: Int
): UserConnection
friendsBackward(
"""Returns the items in the list that come before the specified cursor."""
before: String
"""Returns the last n items from the list."""
last: Int
): UserConnection
}
"""A connection to a list of items."""
Expand Down
6 changes: 6 additions & 0 deletions src/connection/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ import type {
export const forwardConnectionArgs: GraphQLFieldConfigArgumentMap = {
after: {
type: GraphQLString,
description:
'Returns the items in the list that come after the specified cursor.',
},
first: {
type: GraphQLInt,
description: 'Returns the first n items from the list.',
},
};

Expand All @@ -34,9 +37,12 @@ export const forwardConnectionArgs: GraphQLFieldConfigArgumentMap = {
export const backwardConnectionArgs: GraphQLFieldConfigArgumentMap = {
before: {
type: GraphQLString,
description:
'Returns the items in the list that come before the specified cursor.',
},
last: {
type: GraphQLInt,
description: 'Returns the last n items from the list.',
},
};

Expand Down

0 comments on commit 02a5a27

Please sign in to comment.