Skip to content

Commit 02a5a27

Browse files
Added a description to the pagination arguments. (#330)
1 parent 3b0cbd0 commit 02a5a27

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

src/connection/__tests__/connection-test.js

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,33 @@ describe('connectionDefinition()', () => {
189189
190190
type User {
191191
name: String
192-
friends(after: String, first: Int, before: String, last: Int): FriendConnection
193-
friendsForward(after: String, first: Int): UserConnection
194-
friendsBackward(before: String, last: Int): UserConnection
192+
friends(
193+
"""Returns the items in the list that come after the specified cursor."""
194+
after: String
195+
196+
"""Returns the first n items from the list."""
197+
first: Int
198+
199+
"""Returns the items in the list that come before the specified cursor."""
200+
before: String
201+
202+
"""Returns the last n items from the list."""
203+
last: Int
204+
): FriendConnection
205+
friendsForward(
206+
"""Returns the items in the list that come after the specified cursor."""
207+
after: String
208+
209+
"""Returns the first n items from the list."""
210+
first: Int
211+
): UserConnection
212+
friendsBackward(
213+
"""Returns the items in the list that come before the specified cursor."""
214+
before: String
215+
216+
"""Returns the last n items from the list."""
217+
last: Int
218+
): UserConnection
195219
}
196220
197221
"""A connection to a list of items."""

src/connection/connection.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ import type {
2121
export const forwardConnectionArgs: GraphQLFieldConfigArgumentMap = {
2222
after: {
2323
type: GraphQLString,
24+
description:
25+
'Returns the items in the list that come after the specified cursor.',
2426
},
2527
first: {
2628
type: GraphQLInt,
29+
description: 'Returns the first n items from the list.',
2730
},
2831
};
2932

@@ -34,9 +37,12 @@ export const forwardConnectionArgs: GraphQLFieldConfigArgumentMap = {
3437
export const backwardConnectionArgs: GraphQLFieldConfigArgumentMap = {
3538
before: {
3639
type: GraphQLString,
40+
description:
41+
'Returns the items in the list that come before the specified cursor.',
3742
},
3843
last: {
3944
type: GraphQLInt,
45+
description: 'Returns the last n items from the list.',
4046
},
4147
};
4248

0 commit comments

Comments
 (0)