@@ -846,6 +846,7 @@ Feature: GraphQL collection support
846
846
itemsPerPage
847
847
lastPage
848
848
totalCount
849
+ hasNextPage
849
850
}
850
851
}
851
852
}
@@ -862,6 +863,7 @@ Feature: GraphQL collection support
862
863
And the JSON node "data.fooDummies.paginationInfo.itemsPerPage" should be equal to the number 3
863
864
And the JSON node "data.fooDummies.paginationInfo.lastPage" should be equal to the number 2
864
865
And the JSON node "data.fooDummies.paginationInfo.totalCount" should be equal to the number 5
866
+ And the JSON node "data.fooDummies.paginationInfo.hasNextPage" should be true
865
867
When I send the following GraphQL request:
866
868
"""
867
869
{
@@ -970,6 +972,7 @@ Feature: GraphQL collection support
970
972
itemsPerPage
971
973
lastPage
972
974
totalCount
975
+ hasNextPage
973
976
}
974
977
}
975
978
}
@@ -986,3 +989,121 @@ Feature: GraphQL collection support
986
989
And the JSON node "data.fooDummies.paginationInfo.itemsPerPage" should be equal to the number 3
987
990
And the JSON node "data.fooDummies.paginationInfo.lastPage" should be equal to the number 2
988
991
And the JSON node "data.fooDummies.paginationInfo.totalCount" should be equal to the number 5
992
+ And the JSON node "data.fooDummies.paginationInfo.hasNextPage" should be true
993
+ When I send the following GraphQL request:
994
+ """
995
+ {
996
+ fooDummies(page: 2) {
997
+ collection {
998
+ id
999
+ name
1000
+ soManies(first: 2) {
1001
+ edges {
1002
+ node {
1003
+ content
1004
+ }
1005
+ cursor
1006
+ }
1007
+ pageInfo {
1008
+ startCursor
1009
+ endCursor
1010
+ hasNextPage
1011
+ hasPreviousPage
1012
+ }
1013
+ }
1014
+ }
1015
+ paginationInfo {
1016
+ itemsPerPage
1017
+ lastPage
1018
+ totalCount
1019
+ hasNextPage
1020
+ }
1021
+ }
1022
+ }
1023
+ """
1024
+ Then the response status code should be 200
1025
+ And the response should be in JSON
1026
+ And the JSON node "data.fooDummies.collection" should have 2 elements
1027
+ And the JSON node "data.fooDummies.collection[1].id" should exist
1028
+ And the JSON node "data.fooDummies.collection[1].name" should exist
1029
+ And the JSON node "data.fooDummies.collection[1].soManies" should exist
1030
+ And the JSON node "data.fooDummies.collection[1].soManies.edges" should have 2 elements
1031
+ And the JSON node "data.fooDummies.collection[1].soManies.edges[1].node.content" should be equal to "So many 1"
1032
+ And the JSON node "data.fooDummies.collection[1].soManies.pageInfo.startCursor" should be equal to "MA=="
1033
+ And the JSON node "data.fooDummies.paginationInfo.itemsPerPage" should be equal to the number 3
1034
+ And the JSON node "data.fooDummies.paginationInfo.lastPage" should be equal to the number 2
1035
+ And the JSON node "data.fooDummies.paginationInfo.totalCount" should be equal to the number 5
1036
+ And the JSON node "data.fooDummies.paginationInfo.hasNextPage" should be false
1037
+
1038
+ @createSchema
1039
+ Scenario : Retrieve paginated collections using only hasNextPage
1040
+ Given there are 4 fooDummy objects with fake names
1041
+ When I send the following GraphQL request:
1042
+ """
1043
+ {
1044
+ fooDummies(page: 1, itemsPerPage: 2) {
1045
+ collection {
1046
+ id
1047
+ name
1048
+ soManies(first: 2) {
1049
+ edges {
1050
+ node {
1051
+ content
1052
+ }
1053
+ cursor
1054
+ }
1055
+ pageInfo {
1056
+ startCursor
1057
+ endCursor
1058
+ hasNextPage
1059
+ hasPreviousPage
1060
+ }
1061
+ }
1062
+ }
1063
+ paginationInfo {
1064
+ hasNextPage
1065
+ }
1066
+ }
1067
+ }
1068
+ """
1069
+ Then the response status code should be 200
1070
+ And the response should be in JSON
1071
+ And the JSON node "data.fooDummies.collection" should have 2 elements
1072
+ And the JSON node "data.fooDummies.collection[1].id" should exist
1073
+ And the JSON node "data.fooDummies.collection[1].name" should exist
1074
+ And the JSON node "data.fooDummies.collection[1].soManies" should exist
1075
+ And the JSON node "data.fooDummies.collection[1].soManies.edges" should have 2 elements
1076
+ And the JSON node "data.fooDummies.collection[1].soManies.edges[1].node.content" should be equal to "So many 1"
1077
+ And the JSON node "data.fooDummies.collection[1].soManies.pageInfo.startCursor" should be equal to "MA=="
1078
+ And the JSON node "data.fooDummies.paginationInfo.hasNextPage" should be true
1079
+ When I send the following GraphQL request:
1080
+ """
1081
+ {
1082
+ fooDummies(page: 2) {
1083
+ collection {
1084
+ id
1085
+ name
1086
+ soManies(first: 2) {
1087
+ edges {
1088
+ node {
1089
+ content
1090
+ }
1091
+ cursor
1092
+ }
1093
+ pageInfo {
1094
+ startCursor
1095
+ endCursor
1096
+ hasNextPage
1097
+ hasPreviousPage
1098
+ }
1099
+ }
1100
+ }
1101
+ paginationInfo {
1102
+ hasNextPage
1103
+ }
1104
+ }
1105
+ }
1106
+ """
1107
+ Then the response status code should be 200
1108
+ And the response should be in JSON
1109
+ And the JSON node "data.fooDummies.paginationInfo.hasNextPage" should be false
0 commit comments