Skip to content

Commit

Permalink
Remove legacy GraphQL API features (#6196)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown authored Jul 27, 2021
1 parent 6ff7038 commit 5cd8ffd
Show file tree
Hide file tree
Showing 48 changed files with 118 additions and 2,726 deletions.
7 changes: 7 additions & 0 deletions .changeset/brown-glasses-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@keystone-next/fields': major
'@keystone-next/keystone': major
'@keystone-next/types': major
---

Removed `_ListKeyMeta` and `_toManyRelationshipFieldMeta` fields. You should use `listKeyCount` and `toManyRelationshipFieldCount` instead
6 changes: 6 additions & 0 deletions .changeset/cold-cycles-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@keystone-next/keystone': major
'@keystone-next/types': major
---

Removed all arguments from `context.lists.List.count` and `context.db.lists.List.count` except for `where`.
7 changes: 7 additions & 0 deletions .changeset/early-experts-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@keystone-next/fields': major
'@keystone-next/keystone': major
'@keystone-next/types': major
---

Removed `search` argument from the GraphQL API for finding many items, Lists/DB API and to-many relationship fields. You should use `contains` filters instead.
7 changes: 7 additions & 0 deletions .changeset/lovely-pears-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@keystone-next/fields': major
'@keystone-next/keystone': major
'@keystone-next/types': major
---

Removed `sortBy` argument from the GraphQL API for finding many items, Lists/DB API and to-many relationship fields. You should use `orderBy` instead.
71 changes: 0 additions & 71 deletions examples-staging/assets-cloud/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,6 @@ input PostWhereUniqueInput {
id: ID
}

enum SortPostsBy {
id_ASC
id_DESC
title_ASC
title_DESC
status_ASC
status_DESC
content_ASC
content_DESC
publishDate_ASC
publishDate_DESC
}

input PostOrderByInput {
id: OrderDirection
title: OrderDirection
Expand Down Expand Up @@ -181,32 +168,13 @@ type Author {
email: String
posts(
where: PostWhereInput! = {}
search: String
sortBy: [SortPostsBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [PostOrderByInput!]! = []
first: Int
skip: Int! = 0
): [Post!]
_postsMeta(
where: PostWhereInput! = {}
search: String
sortBy: [SortPostsBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [PostOrderByInput!]! = []
first: Int
skip: Int! = 0
): _QueryMeta
@deprecated(
reason: "This query will be removed in a future version. Please use postsCount instead."
)
postsCount(where: PostWhereInput! = {}): Int
}

type _QueryMeta {
count: Int
}

input AuthorWhereInput {
AND: [AuthorWhereInput!]
OR: [AuthorWhereInput!]
Expand Down Expand Up @@ -240,15 +208,6 @@ input AuthorWhereUniqueInput {
email: String
}

enum SortAuthorsBy {
id_ASC
id_DESC
name_ASC
name_DESC
email_ASC
email_DESC
}

input AuthorOrderByInput {
id: OrderDirection
name: OrderDirection
Expand Down Expand Up @@ -309,49 +268,19 @@ type Mutation {
type Query {
allPosts(
where: PostWhereInput! = {}
search: String
sortBy: [SortPostsBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [PostOrderByInput!]! = []
first: Int
skip: Int! = 0
): [Post!]
Post(where: PostWhereUniqueInput!): Post
_allPostsMeta(
where: PostWhereInput! = {}
search: String
sortBy: [SortPostsBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [PostOrderByInput!]! = []
first: Int
skip: Int! = 0
): _QueryMeta
@deprecated(
reason: "This query will be removed in a future version. Please use postsCount instead."
)
postsCount(where: PostWhereInput! = {}): Int
allAuthors(
where: AuthorWhereInput! = {}
search: String
sortBy: [SortAuthorsBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [AuthorOrderByInput!]! = []
first: Int
skip: Int! = 0
): [Author!]
Author(where: AuthorWhereUniqueInput!): Author
_allAuthorsMeta(
where: AuthorWhereInput! = {}
search: String
sortBy: [SortAuthorsBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [AuthorOrderByInput!]! = []
first: Int
skip: Int! = 0
): _QueryMeta
@deprecated(
reason: "This query will be removed in a future version. Please use authorsCount instead."
)
authorsCount(where: AuthorWhereInput! = {}): Int
keystone: KeystoneMeta!
}
Expand Down
71 changes: 0 additions & 71 deletions examples-staging/assets-local/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,6 @@ input PostWhereUniqueInput {
id: ID
}

enum SortPostsBy {
id_ASC
id_DESC
title_ASC
title_DESC
status_ASC
status_DESC
content_ASC
content_DESC
publishDate_ASC
publishDate_DESC
}

input PostOrderByInput {
id: OrderDirection
title: OrderDirection
Expand Down Expand Up @@ -159,32 +146,13 @@ type Author {
email: String
posts(
where: PostWhereInput! = {}
search: String
sortBy: [SortPostsBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [PostOrderByInput!]! = []
first: Int
skip: Int! = 0
): [Post!]
_postsMeta(
where: PostWhereInput! = {}
search: String
sortBy: [SortPostsBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [PostOrderByInput!]! = []
first: Int
skip: Int! = 0
): _QueryMeta
@deprecated(
reason: "This query will be removed in a future version. Please use postsCount instead."
)
postsCount(where: PostWhereInput! = {}): Int
}

type _QueryMeta {
count: Int
}

input AuthorWhereInput {
AND: [AuthorWhereInput!]
OR: [AuthorWhereInput!]
Expand Down Expand Up @@ -218,15 +186,6 @@ input AuthorWhereUniqueInput {
email: String
}

enum SortAuthorsBy {
id_ASC
id_DESC
name_ASC
name_DESC
email_ASC
email_DESC
}

input AuthorOrderByInput {
id: OrderDirection
name: OrderDirection
Expand Down Expand Up @@ -287,49 +246,19 @@ type Mutation {
type Query {
allPosts(
where: PostWhereInput! = {}
search: String
sortBy: [SortPostsBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [PostOrderByInput!]! = []
first: Int
skip: Int! = 0
): [Post!]
Post(where: PostWhereUniqueInput!): Post
_allPostsMeta(
where: PostWhereInput! = {}
search: String
sortBy: [SortPostsBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [PostOrderByInput!]! = []
first: Int
skip: Int! = 0
): _QueryMeta
@deprecated(
reason: "This query will be removed in a future version. Please use postsCount instead."
)
postsCount(where: PostWhereInput! = {}): Int
allAuthors(
where: AuthorWhereInput! = {}
search: String
sortBy: [SortAuthorsBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [AuthorOrderByInput!]! = []
first: Int
skip: Int! = 0
): [Author!]
Author(where: AuthorWhereUniqueInput!): Author
_allAuthorsMeta(
where: AuthorWhereInput! = {}
search: String
sortBy: [SortAuthorsBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [AuthorOrderByInput!]! = []
first: Int
skip: Int! = 0
): _QueryMeta
@deprecated(
reason: "This query will be removed in a future version. Please use authorsCount instead."
)
authorsCount(where: AuthorWhereInput! = {}): Int
keystone: KeystoneMeta!
}
Expand Down
30 changes: 0 additions & 30 deletions examples-staging/auth/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,6 @@ input UserWhereUniqueInput {
email: String
}

enum SortUsersBy {
id_ASC
id_DESC
name_ASC
name_DESC
email_ASC
email_DESC
isAdmin_ASC
isAdmin_DESC
}

input UserOrderByInput {
id: OrderDirection
name: OrderDirection
Expand Down Expand Up @@ -97,10 +86,6 @@ scalar JSON
url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf"
)

type _QueryMeta {
count: Int
}

type Mutation {
createUser(data: UserCreateInput): User
createUsers(data: [UsersCreateInput]): [User]
Expand Down Expand Up @@ -151,26 +136,11 @@ input CreateInitialUserInput {
type Query {
allUsers(
where: UserWhereInput! = {}
search: String
sortBy: [SortUsersBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [UserOrderByInput!]! = []
first: Int
skip: Int! = 0
): [User!]
User(where: UserWhereUniqueInput!): User
_allUsersMeta(
where: UserWhereInput! = {}
search: String
sortBy: [SortUsersBy!]
@deprecated(reason: "sortBy has been deprecated in favour of orderBy")
orderBy: [UserOrderByInput!]! = []
first: Int
skip: Int! = 0
): _QueryMeta
@deprecated(
reason: "This query will be removed in a future version. Please use usersCount instead."
)
usersCount(where: UserWhereInput! = {}): Int
authenticatedItem: AuthenticatedItem
keystone: KeystoneMeta!
Expand Down
Loading

1 comment on commit 5cd8ffd

@vercel
Copy link

@vercel vercel bot commented on 5cd8ffd Jul 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.