Skip to content

Commit

Permalink
Remove prettier formatting the generated schema.graphql (#7874)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown authored Aug 31, 2022
1 parent cee8c06 commit 824dafa
Show file tree
Hide file tree
Showing 37 changed files with 223 additions and 986 deletions.
5 changes: 5 additions & 0 deletions .changeset/moody-jobs-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/core': patch
---

Removes `prettier` from formatting the generated `schema.graphql`
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ docs/public/assets/
prisma-utils/src/generated
nexus-typegen.ts
tests/test-projects/live-reloading/schemas/syntax-error.js
*.vscode
*.vscode
**/schema.graphql
33 changes: 6 additions & 27 deletions examples/assets-local/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ enum PostStatusType {
published
}

scalar DateTime
@specifiedBy(url: "https://datatracker.ietf.org/doc/html/rfc3339#section-5.6")
scalar DateTime @specifiedBy(url: "https://datatracker.ietf.org/doc/html/rfc3339#section-5.6")

type ImageFieldOutput {
id: ID!
Expand Down Expand Up @@ -148,9 +147,7 @@ input ImageFieldInput {
upload: Upload!
}

"""
The `Upload` scalar type represents a file upload.
"""
"""The `Upload` scalar type represents a file upload."""
scalar Upload

input FileFieldInput {
Expand Down Expand Up @@ -181,12 +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): [Post!]
postsCount(where: PostWhereInput! = {}): Int
}

Expand Down Expand Up @@ -249,10 +241,7 @@ input PostRelateToManyForCreateInput {
"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSON
@specifiedBy(
url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf"
)
scalar JSON @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf")

type Mutation {
createPost(data: PostCreateInput!): Post
Expand All @@ -270,20 +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): [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): [Author!]
author(where: AuthorWhereUniqueInput!): Author
authorsCount(where: AuthorWhereInput! = {}): Int
keystone: KeystoneMeta!
Expand Down
33 changes: 6 additions & 27 deletions examples/assets-s3/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ enum PostStatusType {
published
}

scalar DateTime
@specifiedBy(url: "https://datatracker.ietf.org/doc/html/rfc3339#section-5.6")
scalar DateTime @specifiedBy(url: "https://datatracker.ietf.org/doc/html/rfc3339#section-5.6")

type ImageFieldOutput {
id: ID!
Expand Down Expand Up @@ -148,9 +147,7 @@ input ImageFieldInput {
upload: Upload!
}

"""
The `Upload` scalar type represents a file upload.
"""
"""The `Upload` scalar type represents a file upload."""
scalar Upload

input FileFieldInput {
Expand Down Expand Up @@ -181,12 +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): [Post!]
postsCount(where: PostWhereInput! = {}): Int
}

Expand Down Expand Up @@ -249,10 +241,7 @@ input PostRelateToManyForCreateInput {
"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSON
@specifiedBy(
url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf"
)
scalar JSON @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf")

type Mutation {
createPost(data: PostCreateInput!): Post
Expand All @@ -270,20 +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): [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): [Author!]
author(where: AuthorWhereUniqueInput!): Author
authorsCount(where: AuthorWhereInput! = {}): Int
keystone: KeystoneMeta!
Expand Down
25 changes: 5 additions & 20 deletions examples/auth/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@ input UserCreateInput {
"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSON
@specifiedBy(
url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf"
)
scalar JSON @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf")

type Mutation {
createUser(data: UserCreateInput!): User
Expand All @@ -124,18 +121,11 @@ type Mutation {
deleteUser(where: UserWhereUniqueInput!): User
deleteUsers(where: [UserWhereUniqueInput!]!): [User]
endSession: Boolean!
authenticateUserWithPassword(
email: String!
password: String!
): UserAuthenticationWithPasswordResult
createInitialUser(
data: CreateInitialUserInput!
): UserAuthenticationWithPasswordSuccess!
authenticateUserWithPassword(email: String!, password: String!): UserAuthenticationWithPasswordResult
createInitialUser(data: CreateInitialUserInput!): UserAuthenticationWithPasswordSuccess!
}

union UserAuthenticationWithPasswordResult =
UserAuthenticationWithPasswordSuccess
| UserAuthenticationWithPasswordFailure
union UserAuthenticationWithPasswordResult = UserAuthenticationWithPasswordSuccess | UserAuthenticationWithPasswordFailure

type UserAuthenticationWithPasswordSuccess {
sessionToken: String!
Expand All @@ -153,12 +143,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): [User!]
user(where: UserWhereUniqueInput!): User
usersCount(where: UserWhereInput! = {}): Int
keystone: KeystoneMeta!
Expand Down
65 changes: 12 additions & 53 deletions examples/basic/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +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): [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): [Post!]
postsCount(where: PostWhereInput! = {}): Int
randomNumber: Float
}
Expand Down Expand Up @@ -161,9 +151,7 @@ input ImageFieldInput {
upload: Upload!
}

"""
The `Upload` scalar type represents a file upload.
"""
"""The `Upload` scalar type represents a file upload."""
scalar Upload

input FileFieldInput {
Expand Down Expand Up @@ -308,8 +296,7 @@ type Post_content_Document {
document(hydrateRelationships: Boolean! = false): JSON!
}

scalar DateTime
@specifiedBy(url: "https://datatracker.ietf.org/doc/html/rfc3339#section-5.6")
scalar DateTime @specifiedBy(url: "https://datatracker.ietf.org/doc/html/rfc3339#section-5.6")

input PostWhereUniqueInput {
id: ID
Expand Down Expand Up @@ -368,10 +355,7 @@ input PostCreateInput {
"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSON
@specifiedBy(
url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf"
)
scalar JSON @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf")

type Mutation {
createUser(data: UserCreateInput!): User
Expand All @@ -382,10 +366,7 @@ type Mutation {
deleteUsers(where: [UserWhereUniqueInput!]!): [User]
createPhoneNumber(data: PhoneNumberCreateInput!): PhoneNumber
createPhoneNumbers(data: [PhoneNumberCreateInput!]!): [PhoneNumber]
updatePhoneNumber(
where: PhoneNumberWhereUniqueInput!
data: PhoneNumberUpdateInput!
): PhoneNumber
updatePhoneNumber(where: PhoneNumberWhereUniqueInput!, data: PhoneNumberUpdateInput!): PhoneNumber
updatePhoneNumbers(data: [PhoneNumberUpdateArgs!]!): [PhoneNumber]
deletePhoneNumber(where: PhoneNumberWhereUniqueInput!): PhoneNumber
deletePhoneNumbers(where: [PhoneNumberWhereUniqueInput!]!): [PhoneNumber]
Expand All @@ -396,19 +377,12 @@ type Mutation {
deletePost(where: PostWhereUniqueInput!): Post
deletePosts(where: [PostWhereUniqueInput!]!): [Post]
endSession: Boolean!
authenticateUserWithPassword(
email: String!
password: String!
): UserAuthenticationWithPasswordResult
createInitialUser(
data: CreateInitialUserInput!
): UserAuthenticationWithPasswordSuccess!
authenticateUserWithPassword(email: String!, password: String!): UserAuthenticationWithPasswordResult
createInitialUser(data: CreateInitialUserInput!): UserAuthenticationWithPasswordSuccess!
createRandomPosts: [Post!]!
}

union UserAuthenticationWithPasswordResult =
UserAuthenticationWithPasswordSuccess
| UserAuthenticationWithPasswordFailure
union UserAuthenticationWithPasswordResult = UserAuthenticationWithPasswordSuccess | UserAuthenticationWithPasswordFailure

type UserAuthenticationWithPasswordSuccess {
sessionToken: String!
Expand All @@ -426,28 +400,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): [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): [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): [Post!]
post(where: PostWhereUniqueInput!): Post
postsCount(where: PostWhereInput! = {}): Int
keystone: KeystoneMeta!
Expand Down
29 changes: 5 additions & 24 deletions examples/blog/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ enum PostStatusType {
published
}

scalar DateTime
@specifiedBy(url: "https://datatracker.ietf.org/doc/html/rfc3339#section-5.6")
scalar DateTime @specifiedBy(url: "https://datatracker.ietf.org/doc/html/rfc3339#section-5.6")

input PostWhereUniqueInput {
id: ID
Expand Down Expand Up @@ -140,12 +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): [Post!]
postsCount(where: PostWhereInput! = {}): Int
}

Expand Down Expand Up @@ -208,10 +202,7 @@ input PostRelateToManyForCreateInput {
"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSON
@specifiedBy(
url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf"
)
scalar JSON @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf")

type Mutation {
createPost(data: PostCreateInput!): Post
Expand All @@ -229,20 +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): [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): [Author!]
author(where: AuthorWhereUniqueInput!): Author
authorsCount(where: AuthorWhereInput! = {}): Int
keystone: KeystoneMeta!
Expand Down
Loading

0 comments on commit 824dafa

Please sign in to comment.