Skip to content

Commit

Permalink
Make skip non-null with default (keystonejs#5777)
Browse files Browse the repository at this point in the history
* Make skip non-null with default

* WIP
  • Loading branch information
timleslie authored May 24, 2021
1 parent f52079f commit 74bc778
Show file tree
Hide file tree
Showing 17 changed files with 102 additions and 97 deletions.
5 changes: 5 additions & 0 deletions .changeset/dry-suits-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-next/keystone': major
---

Updated the type of the `skip` argument to `allItems` from `Int` to `Int! = 0`.
8 changes: 4 additions & 4 deletions docs/pages/apis/graphql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ type Query {
User(where: UserWhereUniqueInput!): User

""" Search for all User items which match the where clause. """
allUsers(where: UserWhereInput, search: String, sortBy: [SortUsersBy!], orderBy: String, first: Int, skip: Int): [User]
allUsers(where: UserWhereInput, search: String, sortBy: [SortUsersBy!], orderBy: String, first: Int, skip: Int! = 0): [User]

""" Perform a meta-query on all User items which match the where clause. """
_allUsersMeta(where: UserWhereInput, search: String, sortBy: [SortUsersBy!], orderBy: String, first: Int, skip: Int): _QueryMeta
_allUsersMeta(where: UserWhereInput, search: String, sortBy: [SortUsersBy!], orderBy: String, first: Int, skip: Int! = 0): _QueryMeta
}

type Mutation {
Expand Down Expand Up @@ -149,7 +149,7 @@ type User {
```graphql
type Query {
""" Search for all User items which match the where clause. """
allUsers(where: UserWhereInput, search: String, sortBy: [SortUsersBy!], orderBy: String, first: Int, skip: Int): [User]
allUsers(where: UserWhereInput, search: String, sortBy: [SortUsersBy!], orderBy: String, first: Int, skip: Int! = 0): [User]
}

input UserWhereInput {
Expand Down Expand Up @@ -202,7 +202,7 @@ type User {
```graphql
type Query {
""" Perform a meta-query on all User items which match the where clause. """
_allUsersMeta(where: UserWhereInput, search: String, sortBy: [SortUsersBy!], orderBy: String, first: Int, skip: Int): _QueryMeta
_allUsersMeta(where: UserWhereInput, search: String, sortBy: [SortUsersBy!], orderBy: String, first: Int, skip: Int! = 0): _QueryMeta
}

input UserWhereInput {
Expand Down
4 changes: 2 additions & 2 deletions examples/auth/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ type Query {
sortBy: [SortUsersBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): [User]

"""
Expand All @@ -189,7 +189,7 @@ type Query {
sortBy: [SortUsersBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): _QueryMeta
authenticatedItem: AuthenticatedItem
keystone: KeystoneMeta!
Expand Down
20 changes: 10 additions & 10 deletions examples/basic/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -81,31 +81,31 @@ type User {
sortBy: [SortPhoneNumbersBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): [PhoneNumber!]!
_phoneNumbersMeta(
where: PhoneNumberWhereInput
search: String
sortBy: [SortPhoneNumbersBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): _QueryMeta
posts(
where: PostWhereInput
search: String
sortBy: [SortPostsBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): [Post!]!
_postsMeta(
where: PostWhereInput
search: String
sortBy: [SortPostsBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): _QueryMeta
randomNumber: Float
}
Expand Down Expand Up @@ -553,7 +553,7 @@ type Query {
sortBy: [SortUsersBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): [User]

"""
Expand All @@ -570,7 +570,7 @@ type Query {
sortBy: [SortUsersBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): _QueryMeta

"""
Expand All @@ -582,7 +582,7 @@ type Query {
sortBy: [SortPhoneNumbersBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): [PhoneNumber]

"""
Expand All @@ -599,7 +599,7 @@ type Query {
sortBy: [SortPhoneNumbersBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): _QueryMeta

"""
Expand All @@ -611,7 +611,7 @@ type Query {
sortBy: [SortPostsBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): [Post]

"""
Expand All @@ -628,7 +628,7 @@ type Query {
sortBy: [SortPostsBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): _QueryMeta
authenticatedItem: AuthenticatedItem
randomNumber: RandomNumber
Expand Down
12 changes: 6 additions & 6 deletions examples/blog/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ type Author {
sortBy: [SortPostsBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): [Post!]!
_postsMeta(
where: PostWhereInput
search: String
sortBy: [SortPostsBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): _QueryMeta
}

Expand Down Expand Up @@ -298,7 +298,7 @@ type Query {
sortBy: [SortPostsBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): [Post]

"""
Expand All @@ -315,7 +315,7 @@ type Query {
sortBy: [SortPostsBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): _QueryMeta

"""
Expand All @@ -327,7 +327,7 @@ type Query {
sortBy: [SortAuthorsBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): [Author]

"""
Expand All @@ -344,7 +344,7 @@ type Query {
sortBy: [SortAuthorsBy!]
orderBy: String
first: Int
skip: Int
skip: Int! = 0
): _QueryMeta
keystone: KeystoneMeta!
}
Expand Down
Loading

0 comments on commit 74bc778

Please sign in to comment.