-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split incubating pagination tests for better readability (#5546)
- Loading branch information
Showing
20 changed files
with
300 additions
and
221 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
extend schema @link(url: "https://specs.apollo.dev/kotlin_labs/v0.2", import: ["@typePolicy", "@fieldPolicy"]) | ||
|
||
extend type Query @typePolicy(embeddedFields: "hero") | ||
extend type Hero @typePolicy(embeddedFields: "friends") | ||
extend type Hero @typePolicy(embeddedFields: "friends") |
5 changes: 5 additions & 0 deletions
5
tests/pagination/src/commonMain/graphql/pagination/connection/extra.graphqls
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,5 @@ | ||
extend schema @link(url: "https://specs.apollo.dev/kotlin_labs/v0.2", import: ["@typePolicy", "@fieldPolicy"]) | ||
|
||
extend type Query @typePolicy(connectionFields: "users") | ||
|
||
extend type User @typePolicy(keyFields: "id") |
12 changes: 12 additions & 0 deletions
12
tests/pagination/src/commonMain/graphql/pagination/connection/operations.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,12 @@ | ||
query Users($first: Int, $after: String, $last: Int, $before: String) { | ||
users(first: $first, after: $after, last: $last, before: $before) { | ||
edges { | ||
cursor | ||
node { | ||
id | ||
name | ||
} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
tests/pagination/src/commonMain/graphql/pagination/connection/schema.graphqls
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 Query { | ||
users(first: Int = 10, after: String = null, last: Int = null, before: String = null): UserConnection! | ||
} | ||
|
||
type UserConnection { | ||
pageInfo: PageInfo! | ||
edges: [UserEdge!]! | ||
} | ||
|
||
type PageInfo { | ||
startCursor: String! | ||
endCursor: String! | ||
} | ||
|
||
type UserEdge { | ||
cursor: String! | ||
node: User! | ||
} | ||
|
||
type User { | ||
id: ID! | ||
name: String! | ||
email: String! | ||
admin: Boolean | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/pagination/src/commonMain/graphql/pagination/cursorBased/extra.graphqls
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,9 @@ | ||
extend schema @link(url: "https://specs.apollo.dev/kotlin_labs/v0.2", import: ["@typePolicy", "@fieldPolicy"]) | ||
|
||
extend type Query | ||
@typePolicy(embeddedFields: "users") | ||
@fieldPolicy(forField: "users", paginationArgs: "first, after, last, before") | ||
|
||
extend type UserConnection @typePolicy(embeddedFields: "pageInfo, edges") | ||
|
||
extend type User @typePolicy(keyFields: "id") |
12 changes: 12 additions & 0 deletions
12
tests/pagination/src/commonMain/graphql/pagination/cursorBased/operations.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,12 @@ | ||
query Users($first: Int, $after: String, $last: Int, $before: String) { | ||
users(first: $first, after: $after, last: $last, before: $before) { | ||
edges { | ||
cursor | ||
node { | ||
id | ||
name | ||
} | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
tests/pagination/src/commonMain/graphql/pagination/cursorBased/schema.graphqls
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,39 @@ | ||
type Query { | ||
users(first: Int = 10, after: String = null, last: Int = null, before: String = null): UserConnection! | ||
} | ||
|
||
type UserConnection { | ||
pageInfo: PageInfo! | ||
edges: [UserEdge!]! | ||
} | ||
|
||
type UserConnection2 { | ||
pageInfo: PageInfo! | ||
edges: [UserEdge!]! | ||
} | ||
|
||
type UserConnection3 { | ||
pageInfo: PageInfo! | ||
edges: [UserEdge!]! | ||
} | ||
|
||
type PageInfo { | ||
startCursor: String! | ||
endCursor: String! | ||
} | ||
|
||
type UserEdge { | ||
cursor: String! | ||
node: User! | ||
} | ||
|
||
type UserPage { | ||
users: [User!]! | ||
} | ||
|
||
type User { | ||
id: ID! | ||
name: String! | ||
email: String! | ||
admin: Boolean | ||
} |
5 changes: 5 additions & 0 deletions
5
tests/pagination/src/commonMain/graphql/pagination/offsetBasedWithArray/extra.graphqls
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,5 @@ | ||
extend schema @link(url: "https://specs.apollo.dev/kotlin_labs/v0.2", import: ["@typePolicy", "@fieldPolicy"]) | ||
|
||
extend type Query @fieldPolicy(forField: "users", paginationArgs: "offset, limit") | ||
|
||
extend type User @typePolicy(keyFields: "id") |
7 changes: 7 additions & 0 deletions
7
tests/pagination/src/commonMain/graphql/pagination/offsetBasedWithArray/operations.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,7 @@ | ||
query Users($offset: Int, $limit: Int) { | ||
users(offset: $offset, limit: $limit) { | ||
id | ||
name | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/pagination/src/commonMain/graphql/pagination/offsetBasedWithArray/schema.graphqls
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,10 @@ | ||
type Query { | ||
users(offset: Int = 0, limit: Int = 10): [User!]! | ||
} | ||
|
||
type User { | ||
id: ID! | ||
name: String! | ||
email: String! | ||
admin: Boolean | ||
} |
7 changes: 7 additions & 0 deletions
7
tests/pagination/src/commonMain/graphql/pagination/offsetBasedWithPage/extra.graphqls
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,7 @@ | ||
extend schema @link(url: "https://specs.apollo.dev/kotlin_labs/v0.2", import: ["@typePolicy", "@fieldPolicy"]) | ||
|
||
extend type Query | ||
@typePolicy(embeddedFields: "users") | ||
@fieldPolicy(forField: "users", paginationArgs: "offset, limit") | ||
|
||
extend type User @typePolicy(keyFields: "id") |
9 changes: 9 additions & 0 deletions
9
tests/pagination/src/commonMain/graphql/pagination/offsetBasedWithPage/operations.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,9 @@ | ||
query Users($offset: Int, $limit: Int) { | ||
users(offset: $offset, limit: $limit) { | ||
users { | ||
id | ||
name | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/pagination/src/commonMain/graphql/pagination/offsetBasedWithPage/schema.graphqls
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,14 @@ | ||
type Query { | ||
users(offset: Int = 0, limit: Int = 10): UserPage! | ||
} | ||
|
||
type UserPage { | ||
users: [User!]! | ||
} | ||
|
||
type User { | ||
id: ID! | ||
name: String! | ||
email: String! | ||
admin: Boolean | ||
} |
44 changes: 0 additions & 44 deletions
44
tests/pagination/src/commonMain/graphql/pagination/operations.graphql
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
tests/pagination/src/commonMain/graphql/pagination/schema.graphqls
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.