-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(graphql): Added new offset connection with totalCount
* Updated offset paging strategy to return a connection with pageInfo and nodes * Updated offset paging strategy to support total count
- Loading branch information
1 parent
f2f6b99
commit 2780e7e
Showing
65 changed files
with
1,285 additions
and
287 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...ery-graphql/__tests__/__fixtures__/offset-connection-object-type-with-total-count.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
type Test { | ||
stringField: String! | ||
numberField: Float! | ||
boolField: Boolean! | ||
} | ||
|
||
type TestTotalCount { | ||
stringField: String! | ||
} | ||
|
||
type OffsetPageInfo { | ||
"""true if paging forward and there are more records.""" | ||
hasNextPage: Boolean | ||
|
||
"""true if paging backwards and there are more records.""" | ||
hasPreviousPage: Boolean | ||
} | ||
|
||
type TestTotalCountOffsetConnection { | ||
"""Paging information""" | ||
pageInfo: OffsetPageInfo! | ||
|
||
"""Array of nodes.""" | ||
nodes: [TestTotalCount!]! | ||
|
||
"""Fetch total count of records""" | ||
totalCount: Int! | ||
} | ||
|
||
type Query { | ||
test: TestTotalCountOffsetConnection! | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/query-graphql/__tests__/__fixtures__/offset-connection-object-type.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
type Test { | ||
stringField: String! | ||
numberField: Float! | ||
boolField: Boolean! | ||
} | ||
|
||
type OffsetPageInfo { | ||
"""true if paging forward and there are more records.""" | ||
hasNextPage: Boolean | ||
|
||
"""true if paging backwards and there are more records.""" | ||
hasPreviousPage: Boolean | ||
} | ||
|
||
type TestOffsetConnection { | ||
"""Paging information""" | ||
pageInfo: OffsetPageInfo! | ||
|
||
"""Array of nodes.""" | ||
nodes: [Test!]! | ||
} | ||
|
||
type Query { | ||
test: TestOffsetConnection! | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.