Skip to content

Commit

Permalink
Merge branch 'master' into example/admin-ui-customisation
Browse files Browse the repository at this point in the history
  • Loading branch information
gwyneplaine authored Jul 28, 2021
2 parents 46cbc3f + f5e64af commit 960cd05
Show file tree
Hide file tree
Showing 49 changed files with 199 additions and 169 deletions.
8 changes: 8 additions & 0 deletions .changeset/wise-pianos-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@keystone-next/keystone': major
'@keystone-next/types': major
---

The delete mutations now accept `where` unique inputs instead of only an `id`.

If you have a list called `Item`, `deleteItem` now looks like `deleteItem(where: ItemWhereUniqueInput!): Item` and `deleteItems` now looks like `deleteItems(where: [ItemWhereUniqueInput!]!): [Item]`
8 changes: 4 additions & 4 deletions examples-staging/assets-cloud/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,14 @@ type Mutation {
createPosts(data: [PostsCreateInput]): [Post]
updatePost(id: ID!, data: PostUpdateInput): Post
updatePosts(data: [PostUpdateArgs]): [Post]
deletePost(id: ID!): Post
deletePosts(ids: [ID!]): [Post]
deletePost(where: PostWhereUniqueInput!): Post
deletePosts(where: [PostWhereUniqueInput!]!): [Post]
createAuthor(data: AuthorCreateInput): Author
createAuthors(data: [AuthorsCreateInput]): [Author]
updateAuthor(id: ID!, data: AuthorUpdateInput): Author
updateAuthors(data: [AuthorUpdateArgs]): [Author]
deleteAuthor(id: ID!): Author
deleteAuthors(ids: [ID!]): [Author]
deleteAuthor(where: AuthorWhereUniqueInput!): Author
deleteAuthors(where: [AuthorWhereUniqueInput!]!): [Author]
}

type Query {
Expand Down
8 changes: 4 additions & 4 deletions examples-staging/assets-local/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,14 @@ type Mutation {
createPosts(data: [PostsCreateInput]): [Post]
updatePost(id: ID!, data: PostUpdateInput): Post
updatePosts(data: [PostUpdateArgs]): [Post]
deletePost(id: ID!): Post
deletePosts(ids: [ID!]): [Post]
deletePost(where: PostWhereUniqueInput!): Post
deletePosts(where: [PostWhereUniqueInput!]!): [Post]
createAuthor(data: AuthorCreateInput): Author
createAuthors(data: [AuthorsCreateInput]): [Author]
updateAuthor(id: ID!, data: AuthorUpdateInput): Author
updateAuthors(data: [AuthorUpdateArgs]): [Author]
deleteAuthor(id: ID!): Author
deleteAuthors(ids: [ID!]): [Author]
deleteAuthor(where: AuthorWhereUniqueInput!): Author
deleteAuthors(where: [AuthorWhereUniqueInput!]!): [Author]
}

type Query {
Expand Down
4 changes: 2 additions & 2 deletions examples-staging/auth/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ type Mutation {
createUsers(data: [UsersCreateInput]): [User]
updateUser(id: ID!, data: UserUpdateInput): User
updateUsers(data: [UserUpdateArgs]): [User]
deleteUser(id: ID!): User
deleteUsers(ids: [ID!]): [User]
deleteUser(where: UserWhereUniqueInput!): User
deleteUsers(where: [UserWhereUniqueInput!]!): [User]
authenticateUserWithPassword(
email: String!
password: String!
Expand Down
12 changes: 6 additions & 6 deletions examples-staging/basic/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -355,20 +355,20 @@ type Mutation {
createUsers(data: [UsersCreateInput]): [User]
updateUser(id: ID!, data: UserUpdateInput): User
updateUsers(data: [UserUpdateArgs]): [User]
deleteUser(id: ID!): User
deleteUsers(ids: [ID!]): [User]
deleteUser(where: UserWhereUniqueInput!): User
deleteUsers(where: [UserWhereUniqueInput!]!): [User]
createPhoneNumber(data: PhoneNumberCreateInput): PhoneNumber
createPhoneNumbers(data: [PhoneNumbersCreateInput]): [PhoneNumber]
updatePhoneNumber(id: ID!, data: PhoneNumberUpdateInput): PhoneNumber
updatePhoneNumbers(data: [PhoneNumberUpdateArgs]): [PhoneNumber]
deletePhoneNumber(id: ID!): PhoneNumber
deletePhoneNumbers(ids: [ID!]): [PhoneNumber]
deletePhoneNumber(where: PhoneNumberWhereUniqueInput!): PhoneNumber
deletePhoneNumbers(where: [PhoneNumberWhereUniqueInput!]!): [PhoneNumber]
createPost(data: PostCreateInput): Post
createPosts(data: [PostsCreateInput]): [Post]
updatePost(id: ID!, data: PostUpdateInput): Post
updatePosts(data: [PostUpdateArgs]): [Post]
deletePost(id: ID!): Post
deletePosts(ids: [ID!]): [Post]
deletePost(where: PostWhereUniqueInput!): Post
deletePosts(where: [PostWhereUniqueInput!]!): [Post]
authenticateUserWithPassword(
email: String!
password: String!
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/ecommerce/mutations/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function checkout(root: any, { token }: Arguments, context: KeystoneContex
const cartItemIds = user.cart.map((cartItem: any) => cartItem.id);
console.log('gonna create delete cartItems');
await context.lists.CartItem.deleteMany({
ids: cartItemIds,
where: cartItemIds.map((id: string) => ({ id })),
});
return order;
}
Expand Down
28 changes: 14 additions & 14 deletions examples-staging/ecommerce/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -764,44 +764,44 @@ type Mutation {
createUsers(data: [UsersCreateInput]): [User]
updateUser(id: ID!, data: UserUpdateInput): User
updateUsers(data: [UserUpdateArgs]): [User]
deleteUser(id: ID!): User
deleteUsers(ids: [ID!]): [User]
deleteUser(where: UserWhereUniqueInput!): User
deleteUsers(where: [UserWhereUniqueInput!]!): [User]
createProduct(data: ProductCreateInput): Product
createProducts(data: [ProductsCreateInput]): [Product]
updateProduct(id: ID!, data: ProductUpdateInput): Product
updateProducts(data: [ProductUpdateArgs]): [Product]
deleteProduct(id: ID!): Product
deleteProducts(ids: [ID!]): [Product]
deleteProduct(where: ProductWhereUniqueInput!): Product
deleteProducts(where: [ProductWhereUniqueInput!]!): [Product]
createProductImage(data: ProductImageCreateInput): ProductImage
createProductImages(data: [ProductImagesCreateInput]): [ProductImage]
updateProductImage(id: ID!, data: ProductImageUpdateInput): ProductImage
updateProductImages(data: [ProductImageUpdateArgs]): [ProductImage]
deleteProductImage(id: ID!): ProductImage
deleteProductImages(ids: [ID!]): [ProductImage]
deleteProductImage(where: ProductImageWhereUniqueInput!): ProductImage
deleteProductImages(where: [ProductImageWhereUniqueInput!]!): [ProductImage]
createCartItem(data: CartItemCreateInput): CartItem
createCartItems(data: [CartItemsCreateInput]): [CartItem]
updateCartItem(id: ID!, data: CartItemUpdateInput): CartItem
updateCartItems(data: [CartItemUpdateArgs]): [CartItem]
deleteCartItem(id: ID!): CartItem
deleteCartItems(ids: [ID!]): [CartItem]
deleteCartItem(where: CartItemWhereUniqueInput!): CartItem
deleteCartItems(where: [CartItemWhereUniqueInput!]!): [CartItem]
createOrderItem(data: OrderItemCreateInput): OrderItem
createOrderItems(data: [OrderItemsCreateInput]): [OrderItem]
updateOrderItem(id: ID!, data: OrderItemUpdateInput): OrderItem
updateOrderItems(data: [OrderItemUpdateArgs]): [OrderItem]
deleteOrderItem(id: ID!): OrderItem
deleteOrderItems(ids: [ID!]): [OrderItem]
deleteOrderItem(where: OrderItemWhereUniqueInput!): OrderItem
deleteOrderItems(where: [OrderItemWhereUniqueInput!]!): [OrderItem]
createOrder(data: OrderCreateInput): Order
createOrders(data: [OrdersCreateInput]): [Order]
updateOrder(id: ID!, data: OrderUpdateInput): Order
updateOrders(data: [OrderUpdateArgs]): [Order]
deleteOrder(id: ID!): Order
deleteOrders(ids: [ID!]): [Order]
deleteOrder(where: OrderWhereUniqueInput!): Order
deleteOrders(where: [OrderWhereUniqueInput!]!): [Order]
createRole(data: RoleCreateInput): Role
createRoles(data: [RolesCreateInput]): [Role]
updateRole(id: ID!, data: RoleUpdateInput): Role
updateRoles(data: [RoleUpdateArgs]): [Role]
deleteRole(id: ID!): Role
deleteRoles(ids: [ID!]): [Role]
deleteRole(where: RoleWhereUniqueInput!): Role
deleteRoles(where: [RoleWhereUniqueInput!]!): [Role]
authenticateUserWithPassword(
email: String!
password: String!
Expand Down
4 changes: 2 additions & 2 deletions examples-staging/embedded-nextjs/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ type Mutation {
createPosts(data: [PostsCreateInput]): [Post]
updatePost(id: ID!, data: PostUpdateInput): Post
updatePosts(data: [PostUpdateArgs]): [Post]
deletePost(id: ID!): Post
deletePosts(ids: [ID!]): [Post]
deletePost(where: PostWhereUniqueInput!): Post
deletePosts(where: [PostWhereUniqueInput!]!): [Post]
}

type Query {
Expand Down
12 changes: 6 additions & 6 deletions examples-staging/graphql-api-endpoint/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -322,20 +322,20 @@ type Mutation {
createUsers(data: [UsersCreateInput]): [User]
updateUser(id: ID!, data: UserUpdateInput): User
updateUsers(data: [UserUpdateArgs]): [User]
deleteUser(id: ID!): User
deleteUsers(ids: [ID!]): [User]
deleteUser(where: UserWhereUniqueInput!): User
deleteUsers(where: [UserWhereUniqueInput!]!): [User]
createPost(data: PostCreateInput): Post
createPosts(data: [PostsCreateInput]): [Post]
updatePost(id: ID!, data: PostUpdateInput): Post
updatePosts(data: [PostUpdateArgs]): [Post]
deletePost(id: ID!): Post
deletePosts(ids: [ID!]): [Post]
deletePost(where: PostWhereUniqueInput!): Post
deletePosts(where: [PostWhereUniqueInput!]!): [Post]
createTag(data: TagCreateInput): Tag
createTags(data: [TagsCreateInput]): [Tag]
updateTag(id: ID!, data: TagUpdateInput): Tag
updateTags(data: [TagUpdateArgs]): [Tag]
deleteTag(id: ID!): Tag
deleteTags(ids: [ID!]): [Tag]
deleteTag(where: TagWhereUniqueInput!): Tag
deleteTags(where: [TagWhereUniqueInput!]!): [Tag]
authenticateUserWithPassword(
email: String!
password: String!
Expand Down
4 changes: 2 additions & 2 deletions examples-staging/playground/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ type Mutation {
createNotes(data: [NotesCreateInput]): [Note]
updateNote(id: ID!, data: NoteUpdateInput): Note
updateNotes(data: [NoteUpdateArgs]): [Note]
deleteNote(id: ID!): Note
deleteNotes(ids: [ID!]): [Note]
deleteNote(where: NoteWhereUniqueInput!): Note
deleteNotes(where: [NoteWhereUniqueInput!]!): [Note]
}

type Query {
Expand Down
12 changes: 6 additions & 6 deletions examples-staging/roles/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -295,20 +295,20 @@ type Mutation {
createTodos(data: [TodosCreateInput]): [Todo]
updateTodo(id: ID!, data: TodoUpdateInput): Todo
updateTodos(data: [TodoUpdateArgs]): [Todo]
deleteTodo(id: ID!): Todo
deleteTodos(ids: [ID!]): [Todo]
deleteTodo(where: TodoWhereUniqueInput!): Todo
deleteTodos(where: [TodoWhereUniqueInput!]!): [Todo]
createPerson(data: PersonCreateInput): Person
createPeople(data: [PeopleCreateInput]): [Person]
updatePerson(id: ID!, data: PersonUpdateInput): Person
updatePeople(data: [PersonUpdateArgs]): [Person]
deletePerson(id: ID!): Person
deletePeople(ids: [ID!]): [Person]
deletePerson(where: PersonWhereUniqueInput!): Person
deletePeople(where: [PersonWhereUniqueInput!]!): [Person]
createRole(data: RoleCreateInput): Role
createRoles(data: [RolesCreateInput]): [Role]
updateRole(id: ID!, data: RoleUpdateInput): Role
updateRoles(data: [RoleUpdateArgs]): [Role]
deleteRole(id: ID!): Role
deleteRoles(ids: [ID!]): [Role]
deleteRole(where: RoleWhereUniqueInput!): Role
deleteRoles(where: [RoleWhereUniqueInput!]!): [Role]
authenticatePersonWithPassword(
email: String!
password: String!
Expand Down
8 changes: 4 additions & 4 deletions examples-staging/sandbox/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ type Mutation {
createTodos(data: [TodosCreateInput]): [Todo]
updateTodo(id: ID!, data: TodoUpdateInput): Todo
updateTodos(data: [TodoUpdateArgs]): [Todo]
deleteTodo(id: ID!): Todo
deleteTodos(ids: [ID!]): [Todo]
deleteTodo(where: TodoWhereUniqueInput!): Todo
deleteTodos(where: [TodoWhereUniqueInput!]!): [Todo]
createUser(data: UserCreateInput): User
createUsers(data: [UsersCreateInput]): [User]
updateUser(id: ID!, data: UserUpdateInput): User
updateUsers(data: [UserUpdateArgs]): [User]
deleteUser(id: ID!): User
deleteUsers(ids: [ID!]): [User]
deleteUser(where: UserWhereUniqueInput!): User
deleteUsers(where: [UserWhereUniqueInput!]!): [User]
}

type Query {
Expand Down
8 changes: 4 additions & 4 deletions examples/blog/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ type Mutation {
createPosts(data: [PostsCreateInput]): [Post]
updatePost(id: ID!, data: PostUpdateInput): Post
updatePosts(data: [PostUpdateArgs]): [Post]
deletePost(id: ID!): Post
deletePosts(ids: [ID!]): [Post]
deletePost(where: PostWhereUniqueInput!): Post
deletePosts(where: [PostWhereUniqueInput!]!): [Post]
createAuthor(data: AuthorCreateInput): Author
createAuthors(data: [AuthorsCreateInput]): [Author]
updateAuthor(id: ID!, data: AuthorUpdateInput): Author
updateAuthors(data: [AuthorUpdateArgs]): [Author]
deleteAuthor(id: ID!): Author
deleteAuthors(ids: [ID!]): [Author]
deleteAuthor(where: AuthorWhereUniqueInput!): Author
deleteAuthors(where: [AuthorWhereUniqueInput!]!): [Author]
}

type Query {
Expand Down
8 changes: 4 additions & 4 deletions examples/custom-admin-ui-logo/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ type Mutation {
createTasks(data: [TasksCreateInput]): [Task]
updateTask(id: ID!, data: TaskUpdateInput): Task
updateTasks(data: [TaskUpdateArgs]): [Task]
deleteTask(id: ID!): Task
deleteTasks(ids: [ID!]): [Task]
deleteTask(where: TaskWhereUniqueInput!): Task
deleteTasks(where: [TaskWhereUniqueInput!]!): [Task]
createPerson(data: PersonCreateInput): Person
createPeople(data: [PeopleCreateInput]): [Person]
updatePerson(id: ID!, data: PersonUpdateInput): Person
updatePeople(data: [PersonUpdateArgs]): [Person]
deletePerson(id: ID!): Person
deletePeople(ids: [ID!]): [Person]
deletePerson(where: PersonWhereUniqueInput!): Person
deletePeople(where: [PersonWhereUniqueInput!]!): [Person]
}

type Query {
Expand Down
8 changes: 4 additions & 4 deletions examples/custom-field-view/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,14 @@ type Mutation {
createTasks(data: [TasksCreateInput]): [Task]
updateTask(id: ID!, data: TaskUpdateInput): Task
updateTasks(data: [TaskUpdateArgs]): [Task]
deleteTask(id: ID!): Task
deleteTasks(ids: [ID!]): [Task]
deleteTask(where: TaskWhereUniqueInput!): Task
deleteTasks(where: [TaskWhereUniqueInput!]!): [Task]
createPerson(data: PersonCreateInput): Person
createPeople(data: [PeopleCreateInput]): [Person]
updatePerson(id: ID!, data: PersonUpdateInput): Person
updatePeople(data: [PersonUpdateArgs]): [Person]
deletePerson(id: ID!): Person
deletePeople(ids: [ID!]): [Person]
deletePerson(where: PersonWhereUniqueInput!): Person
deletePeople(where: [PersonWhereUniqueInput!]!): [Person]
}

type Query {
Expand Down
8 changes: 4 additions & 4 deletions examples/custom-field/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,14 @@ type Mutation {
createPosts(data: [PostsCreateInput]): [Post]
updatePost(id: ID!, data: PostUpdateInput): Post
updatePosts(data: [PostUpdateArgs]): [Post]
deletePost(id: ID!): Post
deletePosts(ids: [ID!]): [Post]
deletePost(where: PostWhereUniqueInput!): Post
deletePosts(where: [PostWhereUniqueInput!]!): [Post]
createAuthor(data: AuthorCreateInput): Author
createAuthors(data: [AuthorsCreateInput]): [Author]
updateAuthor(id: ID!, data: AuthorUpdateInput): Author
updateAuthors(data: [AuthorUpdateArgs]): [Author]
deleteAuthor(id: ID!): Author
deleteAuthors(ids: [ID!]): [Author]
deleteAuthor(where: AuthorWhereUniqueInput!): Author
deleteAuthors(where: [AuthorWhereUniqueInput!]!): [Author]
}

type Query {
Expand Down
8 changes: 4 additions & 4 deletions examples/default-values/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ type Mutation {
createTasks(data: [TasksCreateInput]): [Task]
updateTask(id: ID!, data: TaskUpdateInput): Task
updateTasks(data: [TaskUpdateArgs]): [Task]
deleteTask(id: ID!): Task
deleteTasks(ids: [ID!]): [Task]
deleteTask(where: TaskWhereUniqueInput!): Task
deleteTasks(where: [TaskWhereUniqueInput!]!): [Task]
createPerson(data: PersonCreateInput): Person
createPeople(data: [PeopleCreateInput]): [Person]
updatePerson(id: ID!, data: PersonUpdateInput): Person
updatePeople(data: [PersonUpdateArgs]): [Person]
deletePerson(id: ID!): Person
deletePeople(ids: [ID!]): [Person]
deletePerson(where: PersonWhereUniqueInput!): Person
deletePeople(where: [PersonWhereUniqueInput!]!): [Person]
}

type Query {
Expand Down
8 changes: 4 additions & 4 deletions examples/document-field/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,14 @@ type Mutation {
createPosts(data: [PostsCreateInput]): [Post]
updatePost(id: ID!, data: PostUpdateInput): Post
updatePosts(data: [PostUpdateArgs]): [Post]
deletePost(id: ID!): Post
deletePosts(ids: [ID!]): [Post]
deletePost(where: PostWhereUniqueInput!): Post
deletePosts(where: [PostWhereUniqueInput!]!): [Post]
createAuthor(data: AuthorCreateInput): Author
createAuthors(data: [AuthorsCreateInput]): [Author]
updateAuthor(id: ID!, data: AuthorUpdateInput): Author
updateAuthors(data: [AuthorUpdateArgs]): [Author]
deleteAuthor(id: ID!): Author
deleteAuthors(ids: [ID!]): [Author]
deleteAuthor(where: AuthorWhereUniqueInput!): Author
deleteAuthors(where: [AuthorWhereUniqueInput!]!): [Author]
}

type Query {
Expand Down
8 changes: 4 additions & 4 deletions examples/extend-graphql-schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ type Mutation {
createPosts(data: [PostsCreateInput]): [Post]
updatePost(id: ID!, data: PostUpdateInput): Post
updatePosts(data: [PostUpdateArgs]): [Post]
deletePost(id: ID!): Post
deletePosts(ids: [ID!]): [Post]
deletePost(where: PostWhereUniqueInput!): Post
deletePosts(where: [PostWhereUniqueInput!]!): [Post]
createAuthor(data: AuthorCreateInput): Author
createAuthors(data: [AuthorsCreateInput]): [Author]
updateAuthor(id: ID!, data: AuthorUpdateInput): Author
updateAuthors(data: [AuthorUpdateArgs]): [Author]
deleteAuthor(id: ID!): Author
deleteAuthors(ids: [ID!]): [Author]
deleteAuthor(where: AuthorWhereUniqueInput!): Author
deleteAuthors(where: [AuthorWhereUniqueInput!]!): [Author]

"""
Publish a post
Expand Down
8 changes: 4 additions & 4 deletions examples/json/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ type Mutation {
createPackages(data: [PackagesCreateInput]): [Package]
updatePackage(id: ID!, data: PackageUpdateInput): Package
updatePackages(data: [PackageUpdateArgs]): [Package]
deletePackage(id: ID!): Package
deletePackages(ids: [ID!]): [Package]
deletePackage(where: PackageWhereUniqueInput!): Package
deletePackages(where: [PackageWhereUniqueInput!]!): [Package]
createPerson(data: PersonCreateInput): Person
createPeople(data: [PeopleCreateInput]): [Person]
updatePerson(id: ID!, data: PersonUpdateInput): Person
updatePeople(data: [PersonUpdateArgs]): [Person]
deletePerson(id: ID!): Person
deletePeople(ids: [ID!]): [Person]
deletePerson(where: PersonWhereUniqueInput!): Person
deletePeople(where: [PersonWhereUniqueInput!]!): [Person]
}

type Query {
Expand Down
Loading

0 comments on commit 960cd05

Please sign in to comment.