diff --git a/.changeset/sour-singers-glow.md b/.changeset/sour-singers-glow.md new file mode 100644 index 00000000000..67db66ac259 --- /dev/null +++ b/.changeset/sour-singers-glow.md @@ -0,0 +1,6 @@ +--- + +'@keystone-6/core': minor +--- + +Add a `cursor` argument for `findMany` queries, enabling cursor-based pagination (see [Prisma.io documentation](https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination) for how this works) diff --git a/examples/assets-local/schema.graphql b/examples/assets-local/schema.graphql index 35457067999..3b74aa07b0d 100644 --- a/examples/assets-local/schema.graphql +++ b/examples/assets-local/schema.graphql @@ -178,7 +178,7 @@ type Author { id: ID! name: String email: String - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int } @@ -259,10 +259,10 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int - authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0): [Author!] + authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: AuthorWhereUniqueInput): [Author!] author(where: AuthorWhereUniqueInput!): Author authorsCount(where: AuthorWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/assets-s3/schema.graphql b/examples/assets-s3/schema.graphql index 35457067999..3b74aa07b0d 100644 --- a/examples/assets-s3/schema.graphql +++ b/examples/assets-s3/schema.graphql @@ -178,7 +178,7 @@ type Author { id: ID! name: String email: String - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int } @@ -259,10 +259,10 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int - authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0): [Author!] + authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: AuthorWhereUniqueInput): [Author!] author(where: AuthorWhereUniqueInput!): Author authorsCount(where: AuthorWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/auth/schema.graphql b/examples/auth/schema.graphql index a403f55d92f..c455019e5a5 100644 --- a/examples/auth/schema.graphql +++ b/examples/auth/schema.graphql @@ -140,7 +140,7 @@ input CreateInitialUserInput { } type Query { - users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0): [User!] + users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: UserWhereUniqueInput): [User!] user(where: UserWhereUniqueInput!): User usersCount(where: UserWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/custom-admin-ui-logo/schema.graphql b/examples/custom-admin-ui-logo/schema.graphql index 772df7bc365..bfe08296c8c 100644 --- a/examples/custom-admin-ui-logo/schema.graphql +++ b/examples/custom-admin-ui-logo/schema.graphql @@ -144,7 +144,7 @@ input PersonRelateToOneForCreateInput { type Person { id: ID! name: String - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] tasksCount(where: TaskWhereInput! = {}): Int } @@ -220,10 +220,10 @@ type Mutation { } type Query { - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] task(where: TaskWhereUniqueInput!): Task tasksCount(where: TaskWhereInput! = {}): Int - people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] person(where: PersonWhereUniqueInput!): Person peopleCount(where: PersonWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/custom-admin-ui-navigation/schema.graphql b/examples/custom-admin-ui-navigation/schema.graphql index 772df7bc365..bfe08296c8c 100644 --- a/examples/custom-admin-ui-navigation/schema.graphql +++ b/examples/custom-admin-ui-navigation/schema.graphql @@ -144,7 +144,7 @@ input PersonRelateToOneForCreateInput { type Person { id: ID! name: String - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] tasksCount(where: TaskWhereInput! = {}): Int } @@ -220,10 +220,10 @@ type Mutation { } type Query { - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] task(where: TaskWhereUniqueInput!): Task tasksCount(where: TaskWhereInput! = {}): Int - people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] person(where: PersonWhereUniqueInput!): Person peopleCount(where: PersonWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/custom-admin-ui-pages/schema.graphql b/examples/custom-admin-ui-pages/schema.graphql index 772df7bc365..bfe08296c8c 100644 --- a/examples/custom-admin-ui-pages/schema.graphql +++ b/examples/custom-admin-ui-pages/schema.graphql @@ -144,7 +144,7 @@ input PersonRelateToOneForCreateInput { type Person { id: ID! name: String - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] tasksCount(where: TaskWhereInput! = {}): Int } @@ -220,10 +220,10 @@ type Mutation { } type Query { - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] task(where: TaskWhereUniqueInput!): Task tasksCount(where: TaskWhereInput! = {}): Int - people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] person(where: PersonWhereUniqueInput!): Person peopleCount(where: PersonWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/custom-field-view/schema.graphql b/examples/custom-field-view/schema.graphql index 3cb4fe818f8..27d0a6f5ba3 100644 --- a/examples/custom-field-view/schema.graphql +++ b/examples/custom-field-view/schema.graphql @@ -147,7 +147,7 @@ input PersonRelateToOneForCreateInput { type Person { id: ID! name: String - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] tasksCount(where: TaskWhereInput! = {}): Int } @@ -223,10 +223,10 @@ type Mutation { } type Query { - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] task(where: TaskWhereUniqueInput!): Task tasksCount(where: TaskWhereInput! = {}): Int - people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] person(where: PersonWhereUniqueInput!): Person peopleCount(where: PersonWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/custom-field/schema.graphql b/examples/custom-field/schema.graphql index fac88a44697..e0a665f6496 100644 --- a/examples/custom-field/schema.graphql +++ b/examples/custom-field/schema.graphql @@ -78,7 +78,7 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/custom-session-validation/schema.graphql b/examples/custom-session-validation/schema.graphql index 889fe7ce72c..78aa95b5c9c 100644 --- a/examples/custom-session-validation/schema.graphql +++ b/examples/custom-session-validation/schema.graphql @@ -147,7 +147,7 @@ type Person { email: String password: PasswordState passwordChangedAt: DateTime - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] tasksCount(where: TaskWhereInput! = {}): Int } @@ -257,10 +257,10 @@ input CreateInitialPersonInput { } type Query { - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] task(where: TaskWhereUniqueInput!): Task tasksCount(where: TaskWhereInput! = {}): Int - people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] person(where: PersonWhereUniqueInput!): Person peopleCount(where: PersonWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/default-values/schema.graphql b/examples/default-values/schema.graphql index 387b255876b..d42f50728e7 100644 --- a/examples/default-values/schema.graphql +++ b/examples/default-values/schema.graphql @@ -162,7 +162,7 @@ input PersonRelateToOneForCreateInput { type Person { id: ID! name: String - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] tasksCount(where: TaskWhereInput! = {}): Int } @@ -238,10 +238,10 @@ type Mutation { } type Query { - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] task(where: TaskWhereUniqueInput!): Task tasksCount(where: TaskWhereInput! = {}): Int - people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] person(where: PersonWhereUniqueInput!): Person peopleCount(where: PersonWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/document-field-customisation/keystone-server/schema.graphql b/examples/document-field-customisation/keystone-server/schema.graphql index 317bf875126..aebb622ed7c 100644 --- a/examples/document-field-customisation/keystone-server/schema.graphql +++ b/examples/document-field-customisation/keystone-server/schema.graphql @@ -5,7 +5,7 @@ type User { id: ID! email: String name: String - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int } @@ -211,10 +211,10 @@ type Mutation { } type Query { - users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0): [User!] + users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: UserWhereUniqueInput): [User!] user(where: UserWhereUniqueInput!): User usersCount(where: UserWhereInput! = {}): Int - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/document-field/schema.graphql b/examples/document-field/schema.graphql index e20a699f184..f67f010e7fa 100644 --- a/examples/document-field/schema.graphql +++ b/examples/document-field/schema.graphql @@ -147,7 +147,7 @@ type Author { id: ID! name: String email: String - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int bio: Author_bio_Document } @@ -235,10 +235,10 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int - authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0): [Author!] + authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: AuthorWhereUniqueInput): [Author!] author(where: AuthorWhereUniqueInput!): Author authorsCount(where: AuthorWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/extend-express-app/schema.graphql b/examples/extend-express-app/schema.graphql index d5c3d89c419..b9130c3383f 100644 --- a/examples/extend-express-app/schema.graphql +++ b/examples/extend-express-app/schema.graphql @@ -144,7 +144,7 @@ input PersonRelateToOneForCreateInput { type Person { id: ID! name: String - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] tasksCount(where: TaskWhereInput! = {}): Int } @@ -221,10 +221,10 @@ type Mutation { } type Query { - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] task(where: TaskWhereUniqueInput!): Task tasksCount(where: TaskWhereInput! = {}): Int - people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] person(where: PersonWhereUniqueInput!): Person peopleCount(where: PersonWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/extend-graphql-schema-graphql-tools/schema.graphql b/examples/extend-graphql-schema-graphql-tools/schema.graphql index 7c676958c13..5d814f68a40 100644 --- a/examples/extend-graphql-schema-graphql-tools/schema.graphql +++ b/examples/extend-graphql-schema-graphql-tools/schema.graphql @@ -139,7 +139,7 @@ type Author { id: ID! name: String email: String - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int } @@ -226,10 +226,10 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int - authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0): [Author!] + authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: AuthorWhereUniqueInput): [Author!] author(where: AuthorWhereUniqueInput!): Author authorsCount(where: AuthorWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/extend-graphql-schema-graphql-ts/schema.graphql b/examples/extend-graphql-schema-graphql-ts/schema.graphql index 1dcaec091c3..c937d0bc566 100644 --- a/examples/extend-graphql-schema-graphql-ts/schema.graphql +++ b/examples/extend-graphql-schema-graphql-ts/schema.graphql @@ -140,7 +140,7 @@ type Author { id: ID! name: String email: String - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int } @@ -222,10 +222,10 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int - authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0): [Author!] + authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: AuthorWhereUniqueInput): [Author!] author(where: AuthorWhereUniqueInput!): Author authorsCount(where: AuthorWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/extend-graphql-schema-nexus/schema.graphql b/examples/extend-graphql-schema-nexus/schema.graphql index b6cc773bb83..0c170606840 100644 --- a/examples/extend-graphql-schema-nexus/schema.graphql +++ b/examples/extend-graphql-schema-nexus/schema.graphql @@ -139,7 +139,7 @@ type Author { id: ID! name: String email: String - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int } @@ -220,10 +220,10 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int - authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0): [Author!] + authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: AuthorWhereUniqueInput): [Author!] author(where: AuthorWhereUniqueInput!): Author authorsCount(where: AuthorWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/extend-graphql-subscriptions/schema.graphql b/examples/extend-graphql-subscriptions/schema.graphql index 8ac4e1c49a5..32a0bea129d 100644 --- a/examples/extend-graphql-subscriptions/schema.graphql +++ b/examples/extend-graphql-subscriptions/schema.graphql @@ -139,7 +139,7 @@ type Author { id: ID! name: String email: String - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int } @@ -223,10 +223,10 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int - authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0): [Author!] + authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: AuthorWhereUniqueInput): [Author!] author(where: AuthorWhereUniqueInput!): Author authorsCount(where: AuthorWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/extend-prisma-schema/schema.graphql b/examples/extend-prisma-schema/schema.graphql index d70e3509ea1..1cb96a88099 100644 --- a/examples/extend-prisma-schema/schema.graphql +++ b/examples/extend-prisma-schema/schema.graphql @@ -158,7 +158,7 @@ input TagRelateToOneForCreateInput { type Tag { id: ID! name: String - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int } @@ -240,13 +240,13 @@ type Mutation { } type Query { - authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0): [Author!] + authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: AuthorWhereUniqueInput): [Author!] author(where: AuthorWhereUniqueInput!): Author authorsCount(where: AuthorWhereInput! = {}): Int - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int - tags(where: TagWhereInput! = {}, orderBy: [TagOrderByInput!]! = [], take: Int, skip: Int! = 0): [Tag!] + tags(where: TagWhereInput! = {}, orderBy: [TagOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TagWhereUniqueInput): [Tag!] tag(where: TagWhereUniqueInput!): Tag tagsCount(where: TagWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/graphql-ts-gql/schema.graphql b/examples/graphql-ts-gql/schema.graphql index f75228d2d7f..883055ca943 100644 --- a/examples/graphql-ts-gql/schema.graphql +++ b/examples/graphql-ts-gql/schema.graphql @@ -149,7 +149,7 @@ type Author { id: ID! name: String email: String - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int latestPost: Post } @@ -231,10 +231,10 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int - authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0): [Author!] + authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: AuthorWhereUniqueInput): [Author!] author(where: AuthorWhereUniqueInput!): Author authorsCount(where: AuthorWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/limits/schema.graphql b/examples/limits/schema.graphql index 7431aa14a9b..7e53eff22da 100644 --- a/examples/limits/schema.graphql +++ b/examples/limits/schema.graphql @@ -95,7 +95,7 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int! = 20, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int! = 20, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/nextjs-keystone-two-servers/keystone-server/schema.graphql b/examples/nextjs-keystone-two-servers/keystone-server/schema.graphql index 317bf875126..aebb622ed7c 100644 --- a/examples/nextjs-keystone-two-servers/keystone-server/schema.graphql +++ b/examples/nextjs-keystone-two-servers/keystone-server/schema.graphql @@ -5,7 +5,7 @@ type User { id: ID! email: String name: String - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int } @@ -211,10 +211,10 @@ type Mutation { } type Query { - users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0): [User!] + users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: UserWhereUniqueInput): [User!] user(where: UserWhereUniqueInput!): User usersCount(where: UserWhereInput! = {}): Int - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/nextjs-keystone/schema.graphql b/examples/nextjs-keystone/schema.graphql index 46e2ab4ca4e..e3f752e6d75 100644 --- a/examples/nextjs-keystone/schema.graphql +++ b/examples/nextjs-keystone/schema.graphql @@ -146,7 +146,7 @@ input CreateInitialUserInput { } type Query { - users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0): [User!] + users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: UserWhereUniqueInput): [User!] user(where: UserWhereUniqueInput!): User usersCount(where: UserWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/redis-session-store/schema.graphql b/examples/redis-session-store/schema.graphql index 9d8525b3638..5df88d70ba8 100644 --- a/examples/redis-session-store/schema.graphql +++ b/examples/redis-session-store/schema.graphql @@ -146,7 +146,7 @@ type Person { name: String email: String password: PasswordState - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] tasksCount(where: TaskWhereInput! = {}): Int } @@ -253,10 +253,10 @@ input CreateInitialPersonInput { } type Query { - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] task(where: TaskWhereUniqueInput!): Task tasksCount(where: TaskWhereInput! = {}): Int - people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] person(where: PersonWhereUniqueInput!): Person peopleCount(where: PersonWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/script/schema.graphql b/examples/script/schema.graphql index b458638c232..20d1647cce6 100644 --- a/examples/script/schema.graphql +++ b/examples/script/schema.graphql @@ -113,7 +113,7 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/singleton/schema.graphql b/examples/singleton/schema.graphql index c952fdd003a..b96987fac29 100644 --- a/examples/singleton/schema.graphql +++ b/examples/singleton/schema.graphql @@ -5,7 +5,7 @@ type Settings { id: ID! websiteName: String copyrightText: String - highlightedPosts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + highlightedPosts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] highlightedPostsCount(where: PostWhereInput! = {}): Int } @@ -187,10 +187,10 @@ type Mutation { } type Query { - manySettings(where: SettingsWhereInput! = {id: {equals: 1}}, orderBy: [SettingsOrderByInput!]! = [], take: Int, skip: Int! = 0): [Settings!] + manySettings(where: SettingsWhereInput! = {id: {equals: 1}}, orderBy: [SettingsOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: SettingsWhereUniqueInput): [Settings!] settings(where: SettingsWhereUniqueInput! = {id: 1}): Settings manySettingsCount(where: SettingsWhereInput! = {id: {equals: 1}}): Int - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/testing/schema.graphql b/examples/testing/schema.graphql index 9d8525b3638..5df88d70ba8 100644 --- a/examples/testing/schema.graphql +++ b/examples/testing/schema.graphql @@ -146,7 +146,7 @@ type Person { name: String email: String password: PasswordState - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] tasksCount(where: TaskWhereInput! = {}): Int } @@ -253,10 +253,10 @@ input CreateInitialPersonInput { } type Query { - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] task(where: TaskWhereUniqueInput!): Task tasksCount(where: TaskWhereInput! = {}): Int - people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] person(where: PersonWhereUniqueInput!): Person peopleCount(where: PersonWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/usecase-basic/schema.graphql b/examples/usecase-basic/schema.graphql index 1fba861feda..717a865bda7 100644 --- a/examples/usecase-basic/schema.graphql +++ b/examples/usecase-basic/schema.graphql @@ -10,9 +10,9 @@ type User { password: PasswordState isAdmin: Boolean roles: String - phoneNumbers(where: PhoneNumberWhereInput! = {}, orderBy: [PhoneNumberOrderByInput!]! = [], take: Int, skip: Int! = 0): [PhoneNumber!] + phoneNumbers(where: PhoneNumberWhereInput! = {}, orderBy: [PhoneNumberOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PhoneNumberWhereUniqueInput): [PhoneNumber!] phoneNumbersCount(where: PhoneNumberWhereInput! = {}): Int - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int randomNumber: Float } @@ -394,13 +394,13 @@ input CreateInitialUserInput { } type Query { - users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0): [User!] + users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: UserWhereUniqueInput): [User!] user(where: UserWhereUniqueInput!): User usersCount(where: UserWhereInput! = {}): Int - phoneNumbers(where: PhoneNumberWhereInput! = {}, orderBy: [PhoneNumberOrderByInput!]! = [], take: Int, skip: Int! = 0): [PhoneNumber!] + phoneNumbers(where: PhoneNumberWhereInput! = {}, orderBy: [PhoneNumberOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PhoneNumberWhereUniqueInput): [PhoneNumber!] phoneNumber(where: PhoneNumberWhereUniqueInput!): PhoneNumber phoneNumbersCount(where: PhoneNumberWhereInput! = {}): Int - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/usecase-blog/schema.graphql b/examples/usecase-blog/schema.graphql index e9ef01656bc..1938109de58 100644 --- a/examples/usecase-blog/schema.graphql +++ b/examples/usecase-blog/schema.graphql @@ -139,7 +139,7 @@ type Author { id: ID! name: String email: String - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int } @@ -220,10 +220,10 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int - authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0): [Author!] + authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: AuthorWhereUniqueInput): [Author!] author(where: AuthorWhereUniqueInput!): Author authorsCount(where: AuthorWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/usecase-ecommerce/schema.graphql b/examples/usecase-ecommerce/schema.graphql index 818b9e27ce2..e32213726ce 100644 --- a/examples/usecase-ecommerce/schema.graphql +++ b/examples/usecase-ecommerce/schema.graphql @@ -6,12 +6,12 @@ type User { name: String email: String password: PasswordState - cart(where: CartItemWhereInput! = {}, orderBy: [CartItemOrderByInput!]! = [], take: Int, skip: Int! = 0): [CartItem!] + cart(where: CartItemWhereInput! = {}, orderBy: [CartItemOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: CartItemWhereUniqueInput): [CartItem!] cartCount(where: CartItemWhereInput! = {}): Int - orders(where: OrderWhereInput! = {}, orderBy: [OrderOrderByInput!]! = [], take: Int, skip: Int! = 0): [Order!] + orders(where: OrderWhereInput! = {}, orderBy: [OrderOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: OrderWhereUniqueInput): [Order!] ordersCount(where: OrderWhereInput! = {}): Int role: Role - products(where: ProductWhereInput! = {}, orderBy: [ProductOrderByInput!]! = [], take: Int, skip: Int! = 0): [Product!] + products(where: ProductWhereInput! = {}, orderBy: [ProductOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: ProductWhereUniqueInput): [Product!] productsCount(where: ProductWhereInput! = {}): Int passwordResetToken: PasswordState passwordResetIssuedAt: DateTime @@ -559,7 +559,7 @@ type Order { id: ID! label: String total: Int - items(where: OrderItemWhereInput! = {}, orderBy: [OrderItemOrderByInput!]! = [], take: Int, skip: Int! = 0): [OrderItem!] + items(where: OrderItemWhereInput! = {}, orderBy: [OrderItemOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: OrderItemWhereUniqueInput): [OrderItem!] itemsCount(where: OrderItemWhereInput! = {}): Int user: User charge: String @@ -632,7 +632,7 @@ type Role { canManageRoles: Boolean canManageCart: Boolean canManageOrders: Boolean - assignedTo(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0): [User!] + assignedTo(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: UserWhereUniqueInput): [User!] assignedToCount(where: UserWhereInput! = {}): Int } @@ -802,25 +802,25 @@ enum PasswordResetRedemptionErrorCode { } type Query { - users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0): [User!] + users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: UserWhereUniqueInput): [User!] user(where: UserWhereUniqueInput!): User usersCount(where: UserWhereInput! = {}): Int - products(where: ProductWhereInput! = {}, orderBy: [ProductOrderByInput!]! = [], take: Int, skip: Int! = 0): [Product!] + products(where: ProductWhereInput! = {}, orderBy: [ProductOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: ProductWhereUniqueInput): [Product!] product(where: ProductWhereUniqueInput!): Product productsCount(where: ProductWhereInput! = {}): Int - productImages(where: ProductImageWhereInput! = {}, orderBy: [ProductImageOrderByInput!]! = [], take: Int, skip: Int! = 0): [ProductImage!] + productImages(where: ProductImageWhereInput! = {}, orderBy: [ProductImageOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: ProductImageWhereUniqueInput): [ProductImage!] productImage(where: ProductImageWhereUniqueInput!): ProductImage productImagesCount(where: ProductImageWhereInput! = {}): Int - cartItems(where: CartItemWhereInput! = {}, orderBy: [CartItemOrderByInput!]! = [], take: Int, skip: Int! = 0): [CartItem!] + cartItems(where: CartItemWhereInput! = {}, orderBy: [CartItemOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: CartItemWhereUniqueInput): [CartItem!] cartItem(where: CartItemWhereUniqueInput!): CartItem cartItemsCount(where: CartItemWhereInput! = {}): Int - orderItems(where: OrderItemWhereInput! = {}, orderBy: [OrderItemOrderByInput!]! = [], take: Int, skip: Int! = 0): [OrderItem!] + orderItems(where: OrderItemWhereInput! = {}, orderBy: [OrderItemOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: OrderItemWhereUniqueInput): [OrderItem!] orderItem(where: OrderItemWhereUniqueInput!): OrderItem orderItemsCount(where: OrderItemWhereInput! = {}): Int - orders(where: OrderWhereInput! = {}, orderBy: [OrderOrderByInput!]! = [], take: Int, skip: Int! = 0): [Order!] + orders(where: OrderWhereInput! = {}, orderBy: [OrderOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: OrderWhereUniqueInput): [Order!] order(where: OrderWhereUniqueInput!): Order ordersCount(where: OrderWhereInput! = {}): Int - roles(where: RoleWhereInput! = {}, orderBy: [RoleOrderByInput!]! = [], take: Int, skip: Int! = 0): [Role!] + roles(where: RoleWhereInput! = {}, orderBy: [RoleOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: RoleWhereUniqueInput): [Role!] role(where: RoleWhereUniqueInput!): Role rolesCount(where: RoleWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/usecase-roles/schema.graphql b/examples/usecase-roles/schema.graphql index ef82ce8024a..53b7a03af3a 100644 --- a/examples/usecase-roles/schema.graphql +++ b/examples/usecase-roles/schema.graphql @@ -116,7 +116,7 @@ type Person { email: String password: PasswordState role: Role - tasks(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0): [Todo!] + tasks(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TodoWhereUniqueInput): [Todo!] tasksCount(where: TodoWhereInput! = {}): Int } @@ -205,7 +205,7 @@ type Role { canEditOtherPeople: Boolean canManagePeople: Boolean canManageRoles: Boolean - assignedTo(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + assignedTo(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] assignedToCount(where: PersonWhereInput! = {}): Int } @@ -331,13 +331,13 @@ input CreateInitialPersonInput { } type Query { - todos(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0): [Todo!] + todos(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TodoWhereUniqueInput): [Todo!] todo(where: TodoWhereUniqueInput!): Todo todosCount(where: TodoWhereInput! = {}): Int - people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] person(where: PersonWhereUniqueInput!): Person peopleCount(where: PersonWhereInput! = {}): Int - roles(where: RoleWhereInput! = {}, orderBy: [RoleOrderByInput!]! = [], take: Int, skip: Int! = 0): [Role!] + roles(where: RoleWhereInput! = {}, orderBy: [RoleOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: RoleWhereUniqueInput): [Role!] role(where: RoleWhereUniqueInput!): Role rolesCount(where: RoleWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/usecase-task-manager/schema.graphql b/examples/usecase-task-manager/schema.graphql index d5c3d89c419..b9130c3383f 100644 --- a/examples/usecase-task-manager/schema.graphql +++ b/examples/usecase-task-manager/schema.graphql @@ -144,7 +144,7 @@ input PersonRelateToOneForCreateInput { type Person { id: ID! name: String - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] tasksCount(where: TaskWhereInput! = {}): Int } @@ -221,10 +221,10 @@ type Mutation { } type Query { - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] task(where: TaskWhereUniqueInput!): Task tasksCount(where: TaskWhereInput! = {}): Int - people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] person(where: PersonWhereUniqueInput!): Person peopleCount(where: PersonWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/usecase-versioning/schema.graphql b/examples/usecase-versioning/schema.graphql index 3e9e001a3bb..9a6339e4ca5 100644 --- a/examples/usecase-versioning/schema.graphql +++ b/examples/usecase-versioning/schema.graphql @@ -116,7 +116,7 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/examples/virtual-field/schema.graphql b/examples/virtual-field/schema.graphql index f75228d2d7f..883055ca943 100644 --- a/examples/virtual-field/schema.graphql +++ b/examples/virtual-field/schema.graphql @@ -149,7 +149,7 @@ type Author { id: ID! name: String email: String - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] postsCount(where: PostWhereInput! = {}): Int latestPost: Post } @@ -231,10 +231,10 @@ type Mutation { } type Query { - posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0): [Post!] + posts(where: PostWhereInput! = {}, orderBy: [PostOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PostWhereUniqueInput): [Post!] post(where: PostWhereUniqueInput!): Post postsCount(where: PostWhereInput! = {}): Int - authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0): [Author!] + authors(where: AuthorWhereInput! = {}, orderBy: [AuthorOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: AuthorWhereUniqueInput): [Author!] author(where: AuthorWhereUniqueInput!): Author authorsCount(where: AuthorWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/packages/core/src/fields/types/relationship/tests/implementation.test.ts b/packages/core/src/fields/types/relationship/tests/implementation.test.ts index 7de146588d3..4ced19ed6d5 100644 --- a/packages/core/src/fields/types/relationship/tests/implementation.test.ts +++ b/packages/core/src/fields/types/relationship/tests/implementation.test.ts @@ -125,7 +125,7 @@ describe('Type Generation', () => { expect(printType(schema.getType('Test')!)).toMatchInlineSnapshot(` "type Test { id: ID! - foo(where: ZipWhereInput! = {}, orderBy: [ZipOrderByInput!]! = [], take: Int, skip: Int! = 0): [Zip!] + foo(where: ZipWhereInput! = {}, orderBy: [ZipOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: ZipWhereUniqueInput): [Zip!] fooCount(where: ZipWhereInput! = {}): Int }" `); diff --git a/packages/core/src/lib/core/queries/resolvers.ts b/packages/core/src/lib/core/queries/resolvers.ts index 0261e95d94c..45785ad5840 100644 --- a/packages/core/src/lib/core/queries/resolvers.ts +++ b/packages/core/src/lib/core/queries/resolvers.ts @@ -108,7 +108,7 @@ export async function findOne( } export async function findMany( - { where, take, skip, orderBy: rawOrderBy }: FindManyArgsValue, + { where, take, skip, orderBy: rawOrderBy, cursor }: FindManyArgsValue, list: InitialisedList, context: KeystoneContext, info: GraphQLResolveInfo, @@ -145,6 +145,7 @@ export async function findMany( orderBy, take: take ?? undefined, skip, + cursor: cursor ?? undefined, }) ); diff --git a/packages/core/src/lib/core/types-for-lists.ts b/packages/core/src/lib/core/types-for-lists.ts index c55375ca826..b119dad2f37 100644 --- a/packages/core/src/lib/core/types-for-lists.ts +++ b/packages/core/src/lib/core/types-for-lists.ts @@ -506,6 +506,7 @@ function getListGraphqlTypes( }), take, skip: graphql.arg({ type: graphql.nonNull(graphql.Int), defaultValue: 0 }), + cursor: graphql.arg({ type: uniqueWhere }), }; const isEnabled = intermediateLists[listKey].graphql.isEnabled; diff --git a/packages/core/src/lib/core/utils.ts b/packages/core/src/lib/core/utils.ts index d2f3f755d87..6289dc14988 100644 --- a/packages/core/src/lib/core/utils.ts +++ b/packages/core/src/lib/core/utils.ts @@ -25,6 +25,7 @@ type PrismaModel = { where?: PrismaFilter; take?: number; skip?: number; + cursor?: UniquePrismaFilter; // this is technically wrong because relation orderBy but we're not doing that yet so it's fine orderBy?: readonly Record[]; include?: Record; diff --git a/packages/core/src/scripts/tests/fixtures/basic-project/schema.graphql b/packages/core/src/scripts/tests/fixtures/basic-project/schema.graphql index 53c579daf53..4d83de34c37 100644 --- a/packages/core/src/scripts/tests/fixtures/basic-project/schema.graphql +++ b/packages/core/src/scripts/tests/fixtures/basic-project/schema.graphql @@ -95,7 +95,7 @@ type Mutation { } type Query { - todos(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0): [Todo!] + todos(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TodoWhereUniqueInput): [Todo!] todo(where: TodoWhereUniqueInput!): Todo todosCount(where: TodoWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/packages/core/src/types/context.ts b/packages/core/src/types/context.ts index 105c4d3c9ad..d4dcb7545bb 100644 --- a/packages/core/src/types/context.ts +++ b/packages/core/src/types/context.ts @@ -51,6 +51,7 @@ export type KeystoneListsAPI[]>; findOne( @@ -106,6 +107,7 @@ export type KeystoneDbAPI; findOne( args: UniqueWhereInput diff --git a/packages/core/src/types/next-fields.ts b/packages/core/src/types/next-fields.ts index 4e2c7a27bbe..032a529f6de 100644 --- a/packages/core/src/types/next-fields.ts +++ b/packages/core/src/types/next-fields.ts @@ -455,6 +455,7 @@ export type FindManyArgs = { >; take: graphql.Arg; skip: graphql.Arg, true>; + cursor: graphql.Arg; }; export type FindManyArgsValue = graphql.InferValueFromArgs; diff --git a/tests/admin-ui-tests/live-reloading.test.ts b/tests/admin-ui-tests/live-reloading.test.ts index 7fe4b142c5a..a707cbf36a5 100644 --- a/tests/admin-ui-tests/live-reloading.test.ts +++ b/tests/admin-ui-tests/live-reloading.test.ts @@ -97,7 +97,7 @@ test('the generated schema includes schema updates', async () => { } type Query { - somethings(where: SomethingWhereInput! = {}, orderBy: [SomethingOrderByInput!]! = [], take: Int, skip: Int! = 0): [Something!] + somethings(where: SomethingWhereInput! = {}, orderBy: [SomethingOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: SomethingWhereUniqueInput): [Something!] something(where: SomethingWhereUniqueInput!): Something somethingsCount(where: SomethingWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/tests/api-tests/queries/cursor-pagination.test.ts b/tests/api-tests/queries/cursor-pagination.test.ts new file mode 100644 index 00000000000..53fd4b5fd1c --- /dev/null +++ b/tests/api-tests/queries/cursor-pagination.test.ts @@ -0,0 +1,243 @@ +import { KeystoneContext } from '@keystone-6/core/types'; +import { setupTestEnv, TestEnv } from '@keystone-6/api-tests/test-runner'; +import { text, relationship, integer } from '@keystone-6/core/fields'; +import { list } from '@keystone-6/core'; +import { allowAll } from '@keystone-6/core/access'; +import { TypeInfoFromConfig, apiTestConfig } from '../utils'; + +const config = apiTestConfig({ + lists: { + Post: list({ + access: allowAll, + fields: { + order: integer({ isIndexed: 'unique' }), + author: relationship({ ref: 'User.posts', many: true }), + }, + }), + User: list({ + access: allowAll, + fields: { + name: text(), + posts: relationship({ ref: 'Post.author', many: true }), + }, + }), + }, +}); + +describe('cursor pagination basic tests', () => { + let testEnv: TestEnv>; + let context: KeystoneContext; + let posts: { id: string }[]; + let userId: string; + + beforeAll(async () => { + testEnv = await setupTestEnv({ config }); + context = testEnv.testArgs.context; + + await testEnv.connect(); + + const result = await context.query.User.createOne({ + data: { + name: 'Test', + posts: { + create: Array.from(Array(15).keys()).map(num => ({ order: num })), + }, + }, + query: 'id posts { id order }', + }); + userId = result.id; + // posts will be added in random sequence, so need to sort by order + posts = result.posts.sort((a: { order: number }, b: { order: number }) => a.order - b.order); + }); + afterAll(async () => { + await testEnv.disconnect(); + }); + + test('cursor pagination test (graphql api)', async () => { + const { errors, data } = await context.graphql.raw({ + query: `query { posts( + take: 6,\ + skip: 1,\ + cursor: { order: 5 }\ + orderBy: { order: asc }\ + ) { id order }\ + }`, + }); + expect(errors).toEqual(undefined); + let currentOrder = 6; + expect(data).toEqual({ + posts: Array.from(Array(6).keys()).map(_ => posts[currentOrder++]), + }); + }); + + test('cursor pagination test (query api)', async () => { + const result1 = await context.query.Post.findMany({ + take: 6, + skip: 1, + cursor: { order: 5 }, + orderBy: { order: 'asc' }, + query: 'id order', + }); + expect(result1).toBeDefined(); + expect(result1.length).toBe(6); + let currentOrder = 6; + expect(result1).toEqual(Array.from(Array(6).keys()).map(_ => posts[currentOrder++])); + }); + + test('cursor pagination test (db api)', async () => { + const result1 = await context.db.Post.findMany({ + take: 6, + skip: 1, + cursor: { order: 5 }, + orderBy: { order: 'asc' }, + }); + expect(result1).toBeDefined(); + expect(result1.length).toBe(6); + let currentOrder = 6; + expect(result1).toEqual(Array.from(Array(6).keys()).map(_ => posts[currentOrder++])); + }); + + test('cursor pagination through relation', async () => { + const { errors, data } = await context.graphql.raw({ + query: `query {\ + user(where: { id: "${userId}"}) {\ + posts(\ + take: 6,\ + skip: 1,\ + cursor: { order: 5 }\ + orderBy: { order: asc }\ + ) { id order }\ + }\ + }`, + }); + expect(errors).toEqual(undefined); + let currentOrder = 6; + expect(data).toEqual({ + user: { posts: Array.from(Array(6).keys()).map(_ => posts[currentOrder++]) }, + }); + }); + + test('cursor pagination forward', async () => { + const result1 = await context.query.Post.findMany({ + take: 6, + orderBy: { order: 'asc' }, + query: 'id order', + }); + expect(result1).toBeDefined(); + let currentOrder = 0; + expect(result1).toEqual(Array.from(Array(6).keys()).map(_ => posts[currentOrder++])); + + const result2 = await context.query.Post.findMany({ + take: 6, + skip: 1, + cursor: { order: result1[result1.length - 1].order }, + orderBy: { order: 'asc' }, + query: 'id order', + }); + + expect(result2).toBeDefined(); + expect(result2).toEqual(Array.from(Array(6).keys()).map(_ => posts[currentOrder++])); + + const result3 = await context.query.Post.findMany({ + take: 6, + skip: 1, + cursor: { order: result2[result2.length - 1].order }, + orderBy: { order: 'asc' }, + query: 'id order', + }); + + expect(result3).toBeDefined(); + expect(result3).toEqual(Array.from(Array(3).keys()).map(_ => posts[currentOrder++])); + }); + + test('cursor pagination backwards', async () => { + const result1 = await context.query.Post.findMany({ + take: -6, + orderBy: { order: 'desc' }, + query: 'id order', + }); + expect(result1).toBeDefined(); + let currentOrder = 5; + expect(result1).toEqual(Array.from(Array(6).keys()).map(_ => posts[currentOrder--])); + + const result2 = await context.query.Post.findMany({ + take: -6, + skip: 1, + cursor: { order: result1[0].order }, + orderBy: { order: 'desc' }, + query: 'id order', + }); + + expect(result2).toBeDefined(); + currentOrder = 11; + expect(result2).toEqual(Array.from(Array(6).keys()).map(_ => posts[currentOrder--])); + + const result3 = await context.query.Post.findMany({ + take: -6, + skip: 1, + cursor: { order: result2[0].order }, + orderBy: { order: 'desc' }, + query: 'id order', + }); + + expect(result3).toBeDefined(); + currentOrder = 14; + expect(result3).toEqual(Array.from(Array(3).keys()).map(_ => posts[currentOrder--])); + }); +}); + +describe('cursor pagination stability', () => { + let testEnv: TestEnv>; + let context: KeystoneContext; + let posts: { id: string }[]; + + beforeEach(async () => { + testEnv = await setupTestEnv({ config }); + context = testEnv.testArgs.context; + + await testEnv.connect(); + + const result = await context.query.User.createOne({ + data: { + name: 'Test', + posts: { + create: Array.from(Array(15).keys()).map(num => ({ order: num })), + }, + }, + query: 'id posts { id order }', + }); + // posts will be added in random sequence, so need to sort by order + posts = result.posts.sort((a: { order: number }, b: { order: number }) => a.order - b.order); + }); + afterEach(async () => { + await testEnv.disconnect(); + }); + + test('insert rows in the middle of pagination and check stability', async () => { + const result1 = await context.query.Post.findMany({ + take: 3, + skip: 1, + cursor: { order: 13 }, + orderBy: { order: 'desc' }, + query: 'id order', + }); + expect(result1).toBeDefined(); + let currentOrder = 12; + expect(result1).toEqual(Array.from(Array(3).keys()).map(_ => posts[currentOrder--])); + + await context.query.Post.createMany({ + data: [{ order: 15 }, { order: 16 }, { order: 17 }, { order: 18 }], + }); + + const result2 = await context.query.Post.findMany({ + take: 3, + skip: 1, + cursor: { order: result1[result1.length - 1].order }, + orderBy: { order: 'desc' }, + query: 'id order', + }); + expect(result2).toBeDefined(); + currentOrder = 9; + expect(result2).toEqual(Array.from(Array(3).keys()).map(_ => posts[currentOrder--])); + }); +}); diff --git a/tests/sandbox/schema.graphql b/tests/sandbox/schema.graphql index 968719ea578..43b27424490 100644 --- a/tests/sandbox/schema.graphql +++ b/tests/sandbox/schema.graphql @@ -9,10 +9,10 @@ type Thing { password: PasswordState toOneRelationship: User toOneRelationshipAlternateLabel: User - toManyRelationship(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0): [Todo!] + toManyRelationship(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TodoWhereUniqueInput): [Todo!] toManyRelationshipCount(where: TodoWhereInput! = {}): Int toOneRelationshipCard: User - toManyRelationshipCard(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0): [Todo!] + toManyRelationshipCard(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TodoWhereUniqueInput): [Todo!] toManyRelationshipCardCount(where: TodoWhereInput! = {}): Int text: String timestamp: DateTime @@ -481,7 +481,7 @@ type User { name: String email: String password: PasswordState - tasks(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0): [Todo!] + tasks(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TodoWhereUniqueInput): [Todo!] tasksCount(where: TodoWhereInput! = {}): Int createdAt: DateTime updatedAt: DateTime @@ -604,16 +604,16 @@ type Mutation { } type Query { - things(where: ThingWhereInput! = {}, orderBy: [ThingOrderByInput!]! = [], take: Int, skip: Int! = 0): [Thing!] + things(where: ThingWhereInput! = {}, orderBy: [ThingOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: ThingWhereUniqueInput): [Thing!] thing(where: ThingWhereUniqueInput!): Thing thingsCount(where: ThingWhereInput! = {}): Int - todos(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0): [Todo!] + todos(where: TodoWhereInput! = {}, orderBy: [TodoOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TodoWhereUniqueInput): [Todo!] todo(where: TodoWhereUniqueInput!): Todo todosCount(where: TodoWhereInput! = {}): Int - users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0): [User!] + users(where: UserWhereInput! = {}, orderBy: [UserOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: UserWhereUniqueInput): [User!] user(where: UserWhereUniqueInput!): User usersCount(where: UserWhereInput! = {}): Int - manySettings(where: SettingsWhereInput! = {id: {equals: 1}}, orderBy: [SettingsOrderByInput!]! = [], take: Int, skip: Int! = 0): [Settings!] + manySettings(where: SettingsWhereInput! = {id: {equals: 1}}, orderBy: [SettingsOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: SettingsWhereUniqueInput): [Settings!] settings(where: SettingsWhereUniqueInput! = {id: 1}): Settings manySettingsCount(where: SettingsWhereInput! = {id: {equals: 1}}): Int keystone: KeystoneMeta! diff --git a/tests/test-projects/basic/schema.graphql b/tests/test-projects/basic/schema.graphql index a0085e13fec..f15389a1b56 100644 --- a/tests/test-projects/basic/schema.graphql +++ b/tests/test-projects/basic/schema.graphql @@ -144,7 +144,7 @@ input PersonRelateToOneForCreateInput { type Person { id: ID! name: String - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] tasksCount(where: TaskWhereInput! = {}): Int } @@ -266,13 +266,13 @@ type Mutation { } type Query { - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] task(where: TaskWhereUniqueInput!): Task tasksCount(where: TaskWhereInput! = {}): Int - people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] person(where: PersonWhereUniqueInput!): Person peopleCount(where: PersonWhereInput! = {}): Int - secretPlans(where: SecretPlanWhereInput! = {}, orderBy: [SecretPlanOrderByInput!]! = [], take: Int, skip: Int! = 0): [SecretPlan!] + secretPlans(where: SecretPlanWhereInput! = {}, orderBy: [SecretPlanOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: SecretPlanWhereUniqueInput): [SecretPlan!] secretPlan(where: SecretPlanWhereUniqueInput!): SecretPlan secretPlansCount(where: SecretPlanWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/tests/test-projects/crud-notifications/schema.graphql b/tests/test-projects/crud-notifications/schema.graphql index 772df7bc365..bfe08296c8c 100644 --- a/tests/test-projects/crud-notifications/schema.graphql +++ b/tests/test-projects/crud-notifications/schema.graphql @@ -144,7 +144,7 @@ input PersonRelateToOneForCreateInput { type Person { id: ID! name: String - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] tasksCount(where: TaskWhereInput! = {}): Int } @@ -220,10 +220,10 @@ type Mutation { } type Query { - tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0): [Task!] + tasks(where: TaskWhereInput! = {}, orderBy: [TaskOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: TaskWhereUniqueInput): [Task!] task(where: TaskWhereUniqueInput!): Task tasksCount(where: TaskWhereInput! = {}): Int - people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0): [Person!] + people(where: PersonWhereInput! = {}, orderBy: [PersonOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: PersonWhereUniqueInput): [Person!] person(where: PersonWhereUniqueInput!): Person peopleCount(where: PersonWhereInput! = {}): Int keystone: KeystoneMeta! diff --git a/tests/test-projects/live-reloading/schema.graphql b/tests/test-projects/live-reloading/schema.graphql index 6a9a5b84f66..d8cee91c5ed 100644 --- a/tests/test-projects/live-reloading/schema.graphql +++ b/tests/test-projects/live-reloading/schema.graphql @@ -95,7 +95,7 @@ type Mutation { } type Query { - somethings(where: SomethingWhereInput! = {}, orderBy: [SomethingOrderByInput!]! = [], take: Int, skip: Int! = 0): [Something!] + somethings(where: SomethingWhereInput! = {}, orderBy: [SomethingOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: SomethingWhereUniqueInput): [Something!] something(where: SomethingWhereUniqueInput!): Something somethingsCount(where: SomethingWhereInput! = {}): Int keystone: KeystoneMeta!