Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up the way endSession and the admin meta is added to the GraphQL schema #6755

Merged
merged 2 commits into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tiny-chairs-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-next/keystone': major
---

Updated the way the `endSession` field on the `Mutation` type and the `keystone` field on the `Query` type are added to the GraphQL schema. This may result in re-ordering in your generated `schema.graphql` file. The `sessionSchema` export of `@keystone-next/keystone/session` has also been removed.
26 changes: 13 additions & 13 deletions examples-staging/auth/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ type Mutation {

union AuthenticatedItem = User

type Query {
authenticatedItem: AuthenticatedItem
users(
where: UserWhereInput! = {}
orderBy: [UserOrderByInput!]! = []
take: Int
skip: Int! = 0
): [User!]
user(where: UserWhereUniqueInput!): User
usersCount(where: UserWhereInput! = {}): Int
keystone: KeystoneMeta!
}

union UserAuthenticationWithPasswordResult =
UserAuthenticationWithPasswordSuccess
| UserAuthenticationWithPasswordFailure
Expand Down Expand Up @@ -154,19 +167,6 @@ scalar JSON
url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf"
)

type Query {
authenticatedItem: AuthenticatedItem
users(
where: UserWhereInput! = {}
orderBy: [UserOrderByInput!]! = []
take: Int
skip: Int! = 0
): [User!]
user(where: UserWhereUniqueInput!): User
usersCount(where: UserWhereInput! = {}): Int
keystone: KeystoneMeta!
}

type KeystoneMeta {
adminMeta: KeystoneAdminMeta!
}
Expand Down
60 changes: 30 additions & 30 deletions examples-staging/basic/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
# This file is automatically generated by Keystone, do not modify it manually.
# Modify your Keystone config when you want to change this.

type Query {
randomNumber: RandomNumber
authenticatedItem: AuthenticatedItem
users(
where: UserWhereInput! = {}
orderBy: [UserOrderByInput!]! = []
take: Int
skip: Int! = 0
): [User!]
user(where: UserWhereUniqueInput!): User
usersCount(where: UserWhereInput! = {}): Int
phoneNumbers(
where: PhoneNumberWhereInput! = {}
orderBy: [PhoneNumberOrderByInput!]! = []
take: Int
skip: Int! = 0
): [PhoneNumber!]
phoneNumber(where: PhoneNumberWhereUniqueInput!): PhoneNumber
phoneNumbersCount(where: PhoneNumberWhereInput! = {}): Int
posts(
where: PostWhereInput! = {}
orderBy: [PostOrderByInput!]! = []
take: Int
skip: Int! = 0
): [Post!]
post(where: PostWhereUniqueInput!): Post
postsCount(where: PostWhereInput! = {}): Int
keystone: KeystoneMeta!
}

type RandomNumber {
number: Int
generatedAt: Int
Expand Down Expand Up @@ -453,36 +483,6 @@ scalar JSON
url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf"
)

type Query {
randomNumber: RandomNumber
authenticatedItem: AuthenticatedItem
users(
where: UserWhereInput! = {}
orderBy: [UserOrderByInput!]! = []
take: Int
skip: Int! = 0
): [User!]
user(where: UserWhereUniqueInput!): User
usersCount(where: UserWhereInput! = {}): Int
phoneNumbers(
where: PhoneNumberWhereInput! = {}
orderBy: [PhoneNumberOrderByInput!]! = []
take: Int
skip: Int! = 0
): [PhoneNumber!]
phoneNumber(where: PhoneNumberWhereUniqueInput!): PhoneNumber
phoneNumbersCount(where: PhoneNumberWhereInput! = {}): Int
posts(
where: PostWhereInput! = {}
orderBy: [PostOrderByInput!]! = []
take: Int
skip: Int! = 0
): [Post!]
post(where: PostWhereUniqueInput!): Post
postsCount(where: PostWhereInput! = {}): Int
keystone: KeystoneMeta!
}

type KeystoneMeta {
adminMeta: KeystoneAdminMeta!
}
Expand Down
130 changes: 65 additions & 65 deletions examples-staging/ecommerce/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,71 @@ type Mutation {
endSession: Boolean!
}

type Query {
validateUserPasswordResetToken(
email: String!
token: String!
): ValidateUserPasswordResetTokenResult
authenticatedItem: AuthenticatedItem
users(
where: UserWhereInput! = {}
orderBy: [UserOrderByInput!]! = []
take: Int
skip: Int! = 0
): [User!]
user(where: UserWhereUniqueInput!): User
usersCount(where: UserWhereInput! = {}): Int
products(
where: ProductWhereInput! = {}
orderBy: [ProductOrderByInput!]! = []
take: Int
skip: Int! = 0
): [Product!]
product(where: ProductWhereUniqueInput!): Product
productsCount(where: ProductWhereInput! = {}): Int
productImages(
where: ProductImageWhereInput! = {}
orderBy: [ProductImageOrderByInput!]! = []
take: Int
skip: Int! = 0
): [ProductImage!]
productImage(where: ProductImageWhereUniqueInput!): ProductImage
productImagesCount(where: ProductImageWhereInput! = {}): Int
cartItems(
where: CartItemWhereInput! = {}
orderBy: [CartItemOrderByInput!]! = []
take: Int
skip: Int! = 0
): [CartItem!]
cartItem(where: CartItemWhereUniqueInput!): CartItem
cartItemsCount(where: CartItemWhereInput! = {}): Int
orderItems(
where: OrderItemWhereInput! = {}
orderBy: [OrderItemOrderByInput!]! = []
take: Int
skip: Int! = 0
): [OrderItem!]
orderItem(where: OrderItemWhereUniqueInput!): OrderItem
orderItemsCount(where: OrderItemWhereInput! = {}): Int
orders(
where: OrderWhereInput! = {}
orderBy: [OrderOrderByInput!]! = []
take: Int
skip: Int! = 0
): [Order!]
order(where: OrderWhereUniqueInput!): Order
ordersCount(where: OrderWhereInput! = {}): Int
roles(
where: RoleWhereInput! = {}
orderBy: [RoleOrderByInput!]! = []
take: Int
skip: Int! = 0
): [Role!]
role(where: RoleWhereUniqueInput!): Role
rolesCount(where: RoleWhereInput! = {}): Int
keystone: KeystoneMeta!
}

type ValidateUserPasswordResetTokenResult {
code: PasswordResetRedemptionErrorCode!
message: String!
Expand Down Expand Up @@ -863,71 +928,6 @@ scalar JSON
url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf"
)

type Query {
validateUserPasswordResetToken(
email: String!
token: String!
): ValidateUserPasswordResetTokenResult
authenticatedItem: AuthenticatedItem
users(
where: UserWhereInput! = {}
orderBy: [UserOrderByInput!]! = []
take: Int
skip: Int! = 0
): [User!]
user(where: UserWhereUniqueInput!): User
usersCount(where: UserWhereInput! = {}): Int
products(
where: ProductWhereInput! = {}
orderBy: [ProductOrderByInput!]! = []
take: Int
skip: Int! = 0
): [Product!]
product(where: ProductWhereUniqueInput!): Product
productsCount(where: ProductWhereInput! = {}): Int
productImages(
where: ProductImageWhereInput! = {}
orderBy: [ProductImageOrderByInput!]! = []
take: Int
skip: Int! = 0
): [ProductImage!]
productImage(where: ProductImageWhereUniqueInput!): ProductImage
productImagesCount(where: ProductImageWhereInput! = {}): Int
cartItems(
where: CartItemWhereInput! = {}
orderBy: [CartItemOrderByInput!]! = []
take: Int
skip: Int! = 0
): [CartItem!]
cartItem(where: CartItemWhereUniqueInput!): CartItem
cartItemsCount(where: CartItemWhereInput! = {}): Int
orderItems(
where: OrderItemWhereInput! = {}
orderBy: [OrderItemOrderByInput!]! = []
take: Int
skip: Int! = 0
): [OrderItem!]
orderItem(where: OrderItemWhereUniqueInput!): OrderItem
orderItemsCount(where: OrderItemWhereInput! = {}): Int
orders(
where: OrderWhereInput! = {}
orderBy: [OrderOrderByInput!]! = []
take: Int
skip: Int! = 0
): [Order!]
order(where: OrderWhereUniqueInput!): Order
ordersCount(where: OrderWhereInput! = {}): Int
roles(
where: RoleWhereInput! = {}
orderBy: [RoleOrderByInput!]! = []
take: Int
skip: Int! = 0
): [Role!]
role(where: RoleWhereUniqueInput!): Role
rolesCount(where: RoleWhereInput! = {}): Int
keystone: KeystoneMeta!
}

type KeystoneMeta {
adminMeta: KeystoneAdminMeta!
}
Expand Down
58 changes: 29 additions & 29 deletions examples-staging/graphql-api-endpoint/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,35 @@ type Mutation {

union AuthenticatedItem = User

type Query {
authenticatedItem: AuthenticatedItem
users(
where: UserWhereInput! = {}
orderBy: [UserOrderByInput!]! = []
take: Int
skip: Int! = 0
): [User!]
user(where: UserWhereUniqueInput!): User
usersCount(where: UserWhereInput! = {}): Int
posts(
where: PostWhereInput! = {}
orderBy: [PostOrderByInput!]! = []
take: Int
skip: Int! = 0
): [Post!]
post(where: PostWhereUniqueInput!): Post
postsCount(where: PostWhereInput! = {}): Int
tags(
where: TagWhereInput! = {}
orderBy: [TagOrderByInput!]! = []
take: Int
skip: Int! = 0
): [Tag!]
tag(where: TagWhereUniqueInput!): Tag
tagsCount(where: TagWhereInput! = {}): Int
keystone: KeystoneMeta!
}

union UserAuthenticationWithPasswordResult =
UserAuthenticationWithPasswordSuccess
| UserAuthenticationWithPasswordFailure
Expand Down Expand Up @@ -373,35 +402,6 @@ scalar JSON
url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf"
)

type Query {
authenticatedItem: AuthenticatedItem
users(
where: UserWhereInput! = {}
orderBy: [UserOrderByInput!]! = []
take: Int
skip: Int! = 0
): [User!]
user(where: UserWhereUniqueInput!): User
usersCount(where: UserWhereInput! = {}): Int
posts(
where: PostWhereInput! = {}
orderBy: [PostOrderByInput!]! = []
take: Int
skip: Int! = 0
): [Post!]
post(where: PostWhereUniqueInput!): Post
postsCount(where: PostWhereInput! = {}): Int
tags(
where: TagWhereInput! = {}
orderBy: [TagOrderByInput!]! = []
take: Int
skip: Int! = 0
): [Tag!]
tag(where: TagWhereUniqueInput!): Tag
tagsCount(where: TagWhereInput! = {}): Int
keystone: KeystoneMeta!
}

type KeystoneMeta {
adminMeta: KeystoneAdminMeta!
}
Expand Down
Loading