What's New
We have a new JSON field ✨, a bunch of new learning resources, and plenty of under the hood optimisations in this big release. 💪
JSON Field 👩🏻💻
Thanks to the new json
field, you can now represent JSON blobs in your backend. Check out the JSON example project to learn more.
Package: list({
fields: {
pkgjson: json({ isRequired: true }),
isPrivate: checkbox(),
ownedBy: relationship({ ref: 'Person.packages', many: false }),
},
}),
More Learning Resources 🧑🏫
In addition to the JSON one above, we added new examples for:
- Setting Default Values for fields.
- Extending the GraphQL Schema with custom queries and mutations.
We also published a tutorial that shows you how to embed Keystone and SQLite in a Next.js app. The end result is an app with a queryable GraphQL endpoint based on your Keystone schema that you can run live on Vercel – for free! 🚀
sortBy
deprecated with improvements to orderBy
🤹♂️
We deprecated the sortBy
GraphQL filter and updated the orderBy
GraphQL filter with an improved API.
Previously a User
list's allUsers
query would have the argument:
orderBy: String
The new API gives it the argument:
orderBy: [UserOrderByInput!]! = []
where
input UserOrderByInput {
id: OrderDirection
name: OrderDirection
score: OrderDirection
}
enum OrderDirection {
asc
desc
}
Rather than writing allUsers(orderBy: "name_ASC")
you now write allUsers(orderBy: { name: asc })
. You can also order by multiple fields, e.g. allUsers(orderBy: [{ score: asc }, { name: asc }])
.
Note: each UserOrderByInput
must have exactly one key, or else an error will be returned.
withItemData
replaced with sessionData
🔧
We removed withItemData
in favour of a sessionData
option to the createAuth()
function.
Previously, withItemData
would be used to wrap the config.session
argument:
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { statelessSessions, withAuthData } from '@keystone-next/keystone/session';
import { text, password, checkbox } from '@keystone-next/fields';
import { createAuth } from '@keystone-next/auth';
const { withAuth } = createAuth({
listKey: 'User',
identityField: 'email',
secretField: 'password',
});
const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' });
export default withAuth(
config({
lists: createSchema({
fields: {
email: text({ isUnique: true }),
password: password(),
isAdmin: checkbox(),
},
}),
session: withItemData(session, { User: 'id isAdmin' }),
}),
})
);
Now, the fields to populate are configured on sessionData
in createAuth
, and withItemData
is completely removed. 🧹
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { statelessSessions } from '@keystone-next/keystone/session';
import { text, password, checkbox } from '@keystone-next/fields';
import { createAuth } from '@keystone-next/auth';
const { withAuth } = createAuth({
listKey: 'User',
identityField: 'email',
secretField: 'password',
sessionData: 'id isAdmin',
});
const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' });
export default withAuth(
config({
lists: createSchema({
fields: {
email: text({ isUnique: true }),
password: password(),
isAdmin: checkbox(),
},
}),
session,
}),
})
);
More consistent and predictable createItems
, updateItems
, and deleteItems
mutations 🧘♀️
We fixed the behaviour of createItems
, updateItems
, and deleteItems
mutations to be consistent and predictable.
Previously, these mutations could return items in an arbitrary order. They now return items in the same order they were provided to the mutation.
Previously, if there was an error (e.g. validation) on one or more of the items – the return value would be null
and a single top level error would be returned. The state of the database in this case was non-deterministic.
The new behaviour is to return values for all items created, with null
values for those that had errors. These errors are returned in the errors
array and have paths which correctly point to the null
values in the returned array. All the valid operations will be completed, leaving the database in a deterministic state.
Previously, if items were filtered out by declarative access control, then no error would be returned, and only those accessible items would be returned. Now the returned data will contain null
values for those items which couldn't accessed, and the errors
array will contain errors with paths which correctly point to the null
values in the returned array.
Previously, if static access control denied access to the mutation, then null
was returned, and a single error
was returned. Now, an array of null
s is returned, with a separate error for each object. This makes the behaviour of static and declarative access control consistent.
Counts Improved 🔢
The GraphQL field _all<path>Meta { count }
generated for many
relationships has been deprecated in favour of a new field <path>Count
, which directly returns the count.
A posts
relationship field would have the following field added to the API:
postsCount(where: PostWhereInput! = {}): Int
Prisma updated to 2.24.0
⬆️
We've updated our Prisma dependency from 2.22.1
to 2.24.0
! Check out the Prisma release notes for more details.
Credits 🎉
-
Thanks @jonowu for adding a
sameSite
option to the session options for cookies. Can be one of true, false, 'strict', 'lax' or 'none' as per Mozilla docs. See the PR for more details! -
Thanks @gabrielkuettel for fixing a typo Database Items API page!
Enjoying Keystone?
Star this repo 🌟 ☝️ or connect to Keystone on Twitter and in Slack.
View verbose release notes
Releases
@keystone-next/auth@26.0.0
Major Changes
-
#5806
0eadba2ba
Thanks [@list({](https://github.com/list({), [@list({](https://github.com/list({)! - RemovedwithItemData
in favour of asessionData
option to thecreateAuth()
function.Previously,
withItemData
would be used to wrap theconfig.session
argument:import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions, withAuthData } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session: withItemData(session, { User: 'id isAdmin' }), }), }) );
Now, the fields to populate are configured on
sessionData
increateAuth
, andwithItemData
is completely removed.import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', sessionData: 'id isAdmin', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session, }), }) );
-
#5787
bb4f4ac91
Thanks @timleslie! - Replacedreq, session, createContext
args toconfig.ui.pageMiddleware
with acontext
arg.
Patch Changes
-
#5766
a2553ab82
Thanks @gwyneplaine! - Added visually hidden labels to signin / welcome fields for better screen reader experience. -
#5827
a0ef39cb3
Thanks @timleslie! - Updated schema extension code to not depend on theBaseKeystone
object. -
#5828
4b11c5ea8
Thanks @timleslie! - Removed thekeystone
argument from theExtendGraphqlSchema
type. This will only impact you if you were directly constructing this function. Users of thegraphQLSchemaExtension
function will not be impacted. -
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,a6a444acd
,29075e580
,59421c039
,5cc35170f
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,0617c81ea
,02af04c03
,107eeb037
,3a7acc2c5
,9de71a9fb
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,38a177d61
,bb4f4ac91
,19a756496
]:- @keystone-next/keystone@19.0.0
- @keystone-next/fields@10.0.0
- @keystone-next/types@19.0.0
- @keystone-ui/fields@4.1.0
- @keystone-next/admin-ui-utils@5.0.1
@keystone-next/fields@10.0.0
Major Changes
-
#5797
a6a444acd
Thanks @timleslie! - The GraphQL field_all<path>Meta { count }
generated formany
relationships has been deprecated in favour of a new field<path>Count
, which directly returns the count.A
posts
relationship field would have the following field added to the API:postsCount(where: PostWhereInput! = {}): Int
Minor Changes
- #5779
59421c039
Thanks @gwyneplaine! - Addedjson
field.
Patch Changes
-
#5815
b9c828fb0
Thanks @timleslie! - Fixed the type oforiginalInput
in the argument todefaultValue
. -
#5799
0617c81ea
Thanks @gwyneplaine! - Fixed field label element, so that it actually refers to the text input. -
#5800
590bb1fe9
Thanks @gwyneplaine! - Fixed text, decimal, float and integer field labels. Labels are now associated with inputs via the field.path attribute. -
#5764
19a756496
Thanks @bladey! - Adjusted fields GqlAuxQueries function to return any type to prevent build errors. -
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,29075e580
,5cc35170f
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,02af04c03
,107eeb037
,3a7acc2c5
,9de71a9fb
,08478b8a7
,7bda87ea7
,4b11c5ea8
,38a177d61
,bb4f4ac91
]:- @keystone-next/keystone@19.0.0
- @keystone-next/types@19.0.0
- @keystone-next/adapter-prisma-legacy@8.0.0
- @keystone-ui/fields@4.1.0
- @keystone-next/admin-ui-utils@5.0.1
- @keystone-next/utils-legacy@11.0.1
@keystone-next/keystone@19.0.0
Major Changes
-
#5806
0eadba2ba
Thanks [@list({](https://github.com/list({), [@list({](https://github.com/list({)! - RemovedwithItemData
in favour of asessionData
option to thecreateAuth()
function.Previously,
withItemData
would be used to wrap theconfig.session
argument:import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions, withAuthData } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session: withItemData(session, { User: 'id isAdmin' }), }), }) );
Now, the fields to populate are configured on
sessionData
increateAuth
, andwithItemData
is completely removed.import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', sessionData: 'id isAdmin', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session, }), }) );
-
#5772
f52079f0b
Thanks @timleslie! - Fixed the behaviour ofcreateItems
,updateItems
, anddeleteItems
mutations to be consistent and predictable.Previously, these mutations could return items in an arbitrary order. They now return items in the same order they were provided to the mutation.
Previously, if there was an error, say a validation error, on one or more of the items then the return value would be
null
and a single top level error would be returned. The state of the database in this case was non-deterministic.The new behaviour is to return values for all items created, with
null
values for those that had errors. These errors are returned in theerrors
array and have paths which correctly point to thenull
values in the returned array. All the valid operations will be completed, leaving the database in a deterministic state.Previously, if items were filtered out by declarative access control, then no error would be returned, and only those accessible items would be returned. Now the returned data will contain
null
values for those items which couldn't accessed, and theerrors
array will contain errors with paths which correctly point to thenull
values in the returned array.Previously, if static access control denied access to the mutation, then
null
was returned, and a singleerror
was returned. Now, an array ofnull
s is returned, with a separate error for each object. This makes the behaviour of static and declarative access control consistent. -
#5777
74bc77854
Thanks @timleslie! - Updated the type of theskip
argument toallItems
fromInt
toInt! = 0
. -
#5792
319c19bd5
Thanks @timleslie! - Changed the type of thewhere
argument toallItems
to_allItemsMeta
from typeItemWhereInput
toItemWhereInput! = {}
. -
#5832
195d4fb12
Thanks @timleslie! - Updated the functionsgetCommittedArtifacts
,validateCommittedArtifacts
,generateCommittedArtifacts
, andgenerateNodeModulesArtifacts
exported fromartifacts.ts
to accept aKeystoneConfig
argument rather than aBaseKeystone
object. -
#5850
5b02e8625
Thanks @timleslie! - TheAND
andOR
operators ofItemWhereInput
now accept non-null values, e.g.[ItemWhereInput!]
, rather than[ItemWhereInput]
. -
#5767
02af04c03
Thanks @timleslie! - Deprecated thesortBy
GraphQL filter. Updated theorderBy
GraphQL filter with an improved API.Previously a
User
list'sallUsers
query would have the argument:orderBy: String
The new API gives it the argument:
orderBy: [UserOrderByInput!]! = []
where
input UserOrderByInput { id: OrderDirection name: OrderDirection score: OrderDirection } enum OrderDirection { asc desc }
Rather than writing
allUsers(orderBy: "name_ASC")
you now writeallUsers(orderBy: { name: asc })
. You can also now order by multiple fields, e.g.allUsers(orderBy: [{ score: asc }, { name: asc }])
. EachUserOrderByInput
must have exactly one key, or else an error will be returned. -
#5791
9de71a9fb
Thanks @timleslie! - Changed the return type ofallItems(...)
from[User]
to[User!]
, as this API can never havenull
items in the return array. -
#5802
7bda87ea7
Thanks @timleslie! - Changedconfig.session
to access aSessionStrategy
object, rather than a() => SessionStrategy
function. You will only need to change your configuration if you're using a customised session strategy. -
#5828
4b11c5ea8
Thanks @timleslie! - Removed thekeystone
argument from theExtendGraphqlSchema
type. This will only impact you if you were directly constructing this function. Users of thegraphQLSchemaExtension
function will not be impacted. -
#5787
bb4f4ac91
Thanks @timleslie! - Replacedreq, session, createContext
args toconfig.ui.pageMiddleware
with acontext
arg.
Minor Changes
-
#5774
107eeb037
Thanks @jonowu! - AddedsameSite
option to session options for cookies -
#5769
08478b8a7
Thanks @timleslie! - The GraphQL query_all<Items>Meta { count }
generated for each list has been deprecated in favour of a new query<items>Count
, which directy returns the count.A
User
list would have the following query added to the API:usersCount(where: UserWhereInput! = {}): Int
Patch Changes
-
#5780
29075e580
Thanks @mitchellhamilton! - Fixed schema type printer to make arguments that have default values be optional -
#5825
c6cd0a6bd
Thanks @timleslie! - Updated the Admin UI to use theitemsCount
GraphQL API. -
#5826
1fe4753f3
Thanks @timleslie! - Updated the list page of the Admin UI to useorderBy
rather thansortBy
to order items. -
#5849
76cdb791b
Thanks @renovate! - Updated Prisma dependencies to2.24.0
. -
#5768
762f17823
Thanks @timleslie! - Updatedcontext.db.lists
API to correctly apply GraphQL defaults to query arguments. -
#5784
38a177d61
Thanks @renovate! - Updated Prisma dependency to2.23.0
. -
Updated dependencies [
b9c828fb0
,a6a444acd
,59421c039
,5cc35170f
,0617c81ea
,02af04c03
,3a7acc2c5
,08478b8a7
,fe5b463ed
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,bb4f4ac91
,19a756496
]:- @keystone-next/fields@10.0.0
- @keystone-next/types@19.0.0
- @keystone-next/adapter-prisma-legacy@8.0.0
- @keystone-ui/fields@4.1.0
- @keystone-ui/popover@4.0.1
- @keystone-next/admin-ui-utils@5.0.1
- @keystone-next/utils-legacy@11.0.1
@keystone-next/types@19.0.0
Major Changes
-
#5815
b9c828fb0
Thanks @timleslie! - Fixed the type oforiginalInput
in the argument todefaultValue
. -
#5802
7bda87ea7
Thanks @timleslie! - Changedconfig.session
to access aSessionStrategy
object, rather than a() => SessionStrategy
function. You will only need to change your configuration if you're using a customised session strategy. -
#5828
4b11c5ea8
Thanks @timleslie! - Removed thekeystone
argument from theExtendGraphqlSchema
type. This will only impact you if you were directly constructing this function. Users of thegraphQLSchemaExtension
function will not be impacted.
Patch Changes
-
#5831
5cc35170f
Thanks @timleslie! - Updated the type ofKeystoneContext.gqlNames
to beGqlNames
rather than justRecord<string,string>
. -
#5767
02af04c03
Thanks @timleslie! - Deprecated thesortBy
GraphQL filter. Updated theorderBy
GraphQL filter with an improved API.Previously a
User
list'sallUsers
query would have the argument:orderBy: String
The new API gives it the argument:
orderBy: [UserOrderByInput!]! = []
where
input UserOrderByInput { id: OrderDirection name: OrderDirection score: OrderDirection } enum OrderDirection { asc desc }
Rather than writing
allUsers(orderBy: "name_ASC")
you now writeallUsers(orderBy: { name: asc })
. You can also now order by multiple fields, e.g.allUsers(orderBy: [{ score: asc }, { name: asc }])
. EachUserOrderByInput
must have exactly one key, or else an error will be returned. -
#5769
08478b8a7
Thanks @timleslie! - The GraphQL query_all<Items>Meta { count }
generated for each list has been deprecated in favour of a new query<items>Count
, which directy returns the count.A
User
list would have the following query added to the API:usersCount(where: UserWhereInput! = {}): Int
-
#5787
bb4f4ac91
Thanks @timleslie! - Replacedreq, session, createContext
args toconfig.ui.pageMiddleware
with acontext
arg. -
Updated dependencies [
b9c828fb0
,a6a444acd
,59421c039
,0617c81ea
,02af04c03
,590bb1fe9
,19a756496
]:- @keystone-next/fields@10.0.0
- @keystone-next/adapter-prisma-legacy@8.0.0
@keystone-next/adapter-prisma-legacy@8.0.0
Major Changes
-
#5767
02af04c03
Thanks @timleslie! - Deprecated thesortBy
GraphQL filter. Updated theorderBy
GraphQL filter with an improved API.Previously a
User
list'sallUsers
query would have the argument:orderBy: String
The new API gives it the argument:
orderBy: [UserOrderByInput!]! = []
where
input UserOrderByInput { id: OrderDirection name: OrderDirection score: OrderDirection } enum OrderDirection { asc desc }
Rather than writing
allUsers(orderBy: "name_ASC")
you now writeallUsers(orderBy: { name: asc })
. You can also now order by multiple fields, e.g.allUsers(orderBy: [{ score: asc }, { name: asc }])
. EachUserOrderByInput
must have exactly one key, or else an error will be returned.
Patch Changes
- Updated dependencies [
b9c828fb0
,a6a444acd
,59421c039
,5cc35170f
,0617c81ea
,02af04c03
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,bb4f4ac91
,19a756496
]:- @keystone-next/fields@10.0.0
- @keystone-next/types@19.0.0
- @keystone-next/utils-legacy@11.0.1
@keystone-next/test-utils-legacy@20.0.0
Major Changes
- #5832
195d4fb12
Thanks @timleslie! - Updated the functionsgetCommittedArtifacts
,validateCommittedArtifacts
,generateCommittedArtifacts
, andgenerateNodeModulesArtifacts
exported fromartifacts.ts
to accept aKeystoneConfig
argument rather than aBaseKeystone
object.
Patch Changes
- Updated dependencies [
0eadba2ba
,f52079f0b
,74bc77854
,29075e580
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,02af04c03
,107eeb037
,9de71a9fb
,08478b8a7
,7bda87ea7
,4b11c5ea8
,38a177d61
,bb4f4ac91
]:- @keystone-next/keystone@19.0.0
- @keystone-next/adapter-prisma-legacy@8.0.0
@keystone-ui/fields@4.1.0
Minor Changes
- #5761
3a7acc2c5
Thanks @gwyneplaine! - Added as prop to FieldContainer component.
Patch Changes
- Updated dependencies [
fe5b463ed
]:- @keystone-ui/popover@4.0.1
@keystone-ui/popover@4.0.1
Patch Changes
- #5811
fe5b463ed
Thanks @gwyneplaine! - Fixed popover to not be focusable or read by screen reader when not visible.
@keystone-next/admin-ui-utils@5.0.1
Patch Changes
- Updated dependencies [
b9c828fb0
,5cc35170f
,02af04c03
,08478b8a7
,7bda87ea7
,4b11c5ea8
,bb4f4ac91
]:- @keystone-next/types@19.0.0
@keystone-next/cloudinary@5.0.1
Patch Changes
- Updated dependencies [
b9c828fb0
,a6a444acd
,59421c039
,5cc35170f
,0617c81ea
,02af04c03
,3a7acc2c5
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,bb4f4ac91
,19a756496
]:- @keystone-next/fields@10.0.0
- @keystone-next/types@19.0.0
- @keystone-next/adapter-prisma-legacy@8.0.0
- @keystone-ui/fields@4.1.0
@keystone-next/fields-document@6.0.1
Patch Changes
-
#5831
5cc35170f
Thanks @timleslie! - Removed reference to the deprecatedcontext.keystone
. -
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,a6a444acd
,29075e580
,59421c039
,5cc35170f
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,0617c81ea
,02af04c03
,107eeb037
,3a7acc2c5
,9de71a9fb
,08478b8a7
,fe5b463ed
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,38a177d61
,bb4f4ac91
,19a756496
]:- @keystone-next/keystone@19.0.0
- @keystone-next/fields@10.0.0
- @keystone-next/types@19.0.0
- @keystone-next/adapter-prisma-legacy@8.0.0
- @keystone-ui/fields@4.1.0
- @keystone-ui/popover@4.0.1
- @keystone-next/admin-ui-utils@5.0.1
@keystone-next/utils-legacy@11.0.1
Patch Changes
- Updated dependencies [
b9c828fb0
,5cc35170f
,02af04c03
,08478b8a7
,7bda87ea7
,4b11c5ea8
,bb4f4ac91
]:- @keystone-next/types@19.0.0
@keystone-next/example-default-values@1.0.0
Major Changes
- #5814
28ca49c3b
Thanks @timleslie! - Initial version of thedefault-values
example.
Patch Changes
-
#5850
5b02e8625
Thanks @timleslie! - TheAND
andOR
operators ofItemWhereInput
now accept non-null values, e.g.[ItemWhereInput!]
, rather than[ItemWhereInput]
. -
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,a6a444acd
,29075e580
,59421c039
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,0617c81ea
,02af04c03
,107eeb037
,9de71a9fb
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,38a177d61
,bb4f4ac91
,19a756496
]:- @keystone-next/keystone@19.0.0
- @keystone-next/fields@10.0.0
@keystone-next/example-extend-graphql-schema@1.0.0
Major Changes
- #5820
8598c8371
Thanks @timleslie! - Initial version of theextend-graphql-schema
example.
Patch Changes
-
#5850
5b02e8625
Thanks @timleslie! - TheAND
andOR
operators ofItemWhereInput
now accept non-null values, e.g.[ItemWhereInput!]
, rather than[ItemWhereInput]
. -
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,a6a444acd
,29075e580
,59421c039
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,0617c81ea
,02af04c03
,107eeb037
,9de71a9fb
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,38a177d61
,bb4f4ac91
,19a756496
]:- @keystone-next/keystone@19.0.0
- @keystone-next/fields@10.0.0
@keystone-next/website@3.1.0
Minor Changes
Patch Changes
-
#5806
0eadba2ba
Thanks [@list({](https://github.com/list({), [@list({](https://github.com/list({)! - RemovedwithItemData
in favour of asessionData
option to thecreateAuth()
function.Previously,
withItemData
would be used to wrap theconfig.session
argument:import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions, withAuthData } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session: withItemData(session, { User: 'id isAdmin' }), }), }) );
Now, the fields to populate are configured on
sessionData
increateAuth
, andwithItemData
is completely removed.import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', sessionData: 'id isAdmin', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session, }), }) );
-
#5771
51aca916b
Thanks @raveling! - New tutorial for Keystone Lite. First draft. -
#5767
02af04c03
Thanks @timleslie! - Deprecated thesortBy
GraphQL filter. Updated theorderBy
GraphQL filter with an improved API.Previously a
User
list'sallUsers
query would have the argument:orderBy: String
The new API gives it the argument:
orderBy: [UserOrderByInput!]! = []
where
input UserOrderByInput { id: OrderDirection name: OrderDirection score: OrderDirection } enum OrderDirection { asc desc }
Rather than writing
allUsers(orderBy: "name_ASC")
you now writeallUsers(orderBy: { name: asc })
. You can also now order by multiple fields, e.g.allUsers(orderBy: [{ score: asc }, { name: asc }])
. EachUserOrderByInput
must have exactly one key, or else an error will be returned. -
#5823
553bad1e7
Thanks @gabrielkuettel! - Fixed a typo in the db items api sample code. -
#5791
9de71a9fb
Thanks @timleslie! - Changed the return type ofallItems(...)
from[User]
to[User!]
, as this API can never havenull
items in the return array. -
#5769
08478b8a7
Thanks @timleslie! - The GraphQL query_all<Items>Meta { count }
generated for each list has been deprecated in favour of a new query<items>Count
, which directy returns the count.A
User
list would have the following query added to the API:usersCount(where: UserWhereInput! = {}): Int
-
Updated dependencies [
5cc35170f
,3a7acc2c5
]:- @keystone-next/fields-document@6.0.1
- @keystone-ui/fields@4.1.0
@keystone-next/example-auth@4.0.1
Patch Changes
-
#5806
0eadba2ba
Thanks [@list({](https://github.com/list({), [@list({](https://github.com/list({)! - RemovedwithItemData
in favour of asessionData
option to thecreateAuth()
function.Previously,
withItemData
would be used to wrap theconfig.session
argument:import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions, withAuthData } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session: withItemData(session, { User: 'id isAdmin' }), }), }) );
Now, the fields to populate are configured on
sessionData
increateAuth
, andwithItemData
is completely removed.import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', sessionData: 'id isAdmin', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session, }), }) );
-
#5792
319c19bd5
Thanks @timleslie! - Changed the type of thewhere
argument toallItems
to_allItemsMeta
from typeItemWhereInput
toItemWhereInput! = {}
. -
#5850
5b02e8625
Thanks @timleslie! - TheAND
andOR
operators ofItemWhereInput
now accept non-null values, e.g.[ItemWhereInput!]
, rather than[ItemWhereInput]
. -
#5767
02af04c03
Thanks @timleslie! - Deprecated thesortBy
GraphQL filter. Updated theorderBy
GraphQL filter with an improved API.Previously a
User
list'sallUsers
query would have the argument:orderBy: String
The new API gives it the argument:
orderBy: [UserOrderByInput!]! = []
where
input UserOrderByInput { id: OrderDirection name: OrderDirection score: OrderDirection } enum OrderDirection { asc desc }
Rather than writing
allUsers(orderBy: "name_ASC")
you now writeallUsers(orderBy: { name: asc })
. You can also now order by multiple fields, e.g.allUsers(orderBy: [{ score: asc }, { name: asc }])
. EachUserOrderByInput
must have exactly one key, or else an error will be returned. -
#5791
9de71a9fb
Thanks @timleslie! - Changed the return type ofallItems(...)
from[User]
to[User!]
, as this API can never havenull
items in the return array. -
#5769
08478b8a7
Thanks @timleslie! - The GraphQL query_all<Items>Meta { count }
generated for each list has been deprecated in favour of a new query<items>Count
, which directy returns the count.A
User
list would have the following query added to the API:usersCount(where: UserWhereInput! = {}): Int
-
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,a6a444acd
,29075e580
,a2553ab82
,59421c039
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,0617c81ea
,02af04c03
,107eeb037
,a0ef39cb3
,9de71a9fb
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,38a177d61
,bb4f4ac91
,19a756496
]:- @keystone-next/auth@26.0.0
- @keystone-next/keystone@19.0.0
- @keystone-next/fields@10.0.0
@keystone-next/app-basic@4.0.1
Patch Changes
-
#5806
0eadba2ba
Thanks [@list({](https://github.com/list({), [@list({](https://github.com/list({)! - RemovedwithItemData
in favour of asessionData
option to thecreateAuth()
function.Previously,
withItemData
would be used to wrap theconfig.session
argument:import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions, withAuthData } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session: withItemData(session, { User: 'id isAdmin' }), }), }) );
Now, the fields to populate are configured on
sessionData
increateAuth
, andwithItemData
is completely removed.import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', sessionData: 'id isAdmin', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session, }), }) );
-
#5797
a6a444acd
Thanks @timleslie! - The GraphQL field_all<path>Meta { count }
generated formany
relationships has been deprecated in favour of a new field<path>Count
, which directly returns the count.A
posts
relationship field would have the following field added to the API:postsCount(where: PostWhereInput! = {}): Int
-
#5792
319c19bd5
Thanks @timleslie! - Changed the type of thewhere
argument toallItems
to_allItemsMeta
from typeItemWhereInput
toItemWhereInput! = {}
. -
#5850
5b02e8625
Thanks @timleslie! - TheAND
andOR
operators ofItemWhereInput
now accept non-null values, e.g.[ItemWhereInput!]
, rather than[ItemWhereInput]
. -
#5767
02af04c03
Thanks @timleslie! - Deprecated thesortBy
GraphQL filter. Updated theorderBy
GraphQL filter with an improved API.Previously a
User
list'sallUsers
query would have the argument:orderBy: String
The new API gives it the argument:
orderBy: [UserOrderByInput!]! = []
where
input UserOrderByInput { id: OrderDirection name: OrderDirection score: OrderDirection } enum OrderDirection { asc desc }
Rather than writing
allUsers(orderBy: "name_ASC")
you now writeallUsers(orderBy: { name: asc })
. You can also now order by multiple fields, e.g.allUsers(orderBy: [{ score: asc }, { name: asc }])
. EachUserOrderByInput
must have exactly one key, or else an error will be returned. -
#5791
9de71a9fb
Thanks @timleslie! - Changed the return type ofallItems(...)
from[User]
to[User!]
, as this API can never havenull
items in the return array. -
#5769
08478b8a7
Thanks @timleslie! - The GraphQL query_all<Items>Meta { count }
generated for each list has been deprecated in favour of a new query<items>Count
, which directy returns the count.A
User
list would have the following query added to the API:usersCount(where: UserWhereInput! = {}): Int
-
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,5cc35170f
,a6a444acd
,29075e580
,a2553ab82
,59421c039
,5cc35170f
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,0617c81ea
,02af04c03
,107eeb037
,3a7acc2c5
,a0ef39cb3
,9de71a9fb
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,38a177d61
,bb4f4ac91
,19a756496
]:- @keystone-next/auth@26.0.0
- @keystone-next/keystone@19.0.0
- @keystone-next/fields@10.0.0
- @keystone-next/types@19.0.0
- @keystone-next/fields-document@6.0.1
- @keystone-ui/fields@4.1.0
@keystone-next/example-ecommerce@4.0.1
Patch Changes
-
#5806
0eadba2ba
Thanks [@list({](https://github.com/list({), [@list({](https://github.com/list({)! - RemovedwithItemData
in favour of asessionData
option to thecreateAuth()
function.Previously,
withItemData
would be used to wrap theconfig.session
argument:import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions, withAuthData } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session: withItemData(session, { User: 'id isAdmin' }), }), }) );
Now, the fields to populate are configured on
sessionData
increateAuth
, andwithItemData
is completely removed.import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', sessionData: 'id isAdmin', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session, }), }) );
-
#5797
a6a444acd
Thanks @timleslie! - The GraphQL field_all<path>Meta { count }
generated formany
relationships has been deprecated in favour of a new field<path>Count
, which directly returns the count.A
posts
relationship field would have the following field added to the API:postsCount(where: PostWhereInput! = {}): Int
-
#5792
319c19bd5
Thanks @timleslie! - Changed the type of thewhere
argument toallItems
to_allItemsMeta
from typeItemWhereInput
toItemWhereInput! = {}
. -
#5850
5b02e8625
Thanks @timleslie! - TheAND
andOR
operators ofItemWhereInput
now accept non-null values, e.g.[ItemWhereInput!]
, rather than[ItemWhereInput]
. -
#5829
f36a70a55
Thanks @timleslie! - UpdatedinsertSeedData
to directly accesscontext.prisma
. -
#5767
02af04c03
Thanks @timleslie! - Deprecated thesortBy
GraphQL filter. Updated theorderBy
GraphQL filter with an improved API.Previously a
User
list'sallUsers
query would have the argument:orderBy: String
The new API gives it the argument:
orderBy: [UserOrderByInput!]! = []
where
input UserOrderByInput { id: OrderDirection name: OrderDirection score: OrderDirection } enum OrderDirection { asc desc }
Rather than writing
allUsers(orderBy: "name_ASC")
you now writeallUsers(orderBy: { name: asc })
. You can also now order by multiple fields, e.g.allUsers(orderBy: [{ score: asc }, { name: asc }])
. EachUserOrderByInput
must have exactly one key, or else an error will be returned. -
#5791
9de71a9fb
Thanks @timleslie! - Changed the return type ofallItems(...)
from[User]
to[User!]
, as this API can never havenull
items in the return array. -
#5769
08478b8a7
Thanks @timleslie! - The GraphQL query_all<Items>Meta { count }
generated for each list has been deprecated in favour of a new query<items>Count
, which directy returns the count.A
User
list would have the following query added to the API:usersCount(where: UserWhereInput! = {}): Int
-
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,a6a444acd
,29075e580
,a2553ab82
,59421c039
,5cc35170f
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,0617c81ea
,02af04c03
,107eeb037
,a0ef39cb3
,9de71a9fb
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,38a177d61
,bb4f4ac91
,19a756496
]:- @keystone-next/auth@26.0.0
- @keystone-next/keystone@19.0.0
- @keystone-next/fields@10.0.0
- @keystone-next/types@19.0.0
- @keystone-next/cloudinary@5.0.1
@keystone-next/example-embedded-nextjs@3.0.1
Patch Changes
-
#5792
319c19bd5
Thanks @timleslie! - Changed the type of thewhere
argument toallItems
to_allItemsMeta
from typeItemWhereInput
toItemWhereInput! = {}
. -
#5850
5b02e8625
Thanks @timleslie! - TheAND
andOR
operators ofItemWhereInput
now accept non-null values, e.g.[ItemWhereInput!]
, rather than[ItemWhereInput]
. -
#5767
02af04c03
Thanks @timleslie! - Deprecated thesortBy
GraphQL filter. Updated theorderBy
GraphQL filter with an improved API.Previously a
User
list'sallUsers
query would have the argument:orderBy: String
The new API gives it the argument:
orderBy: [UserOrderByInput!]! = []
where
input UserOrderByInput { id: OrderDirection name: OrderDirection score: OrderDirection } enum OrderDirection { asc desc }
Rather than writing
allUsers(orderBy: "name_ASC")
you now writeallUsers(orderBy: { name: asc })
. You can also now order by multiple fields, e.g.allUsers(orderBy: [{ score: asc }, { name: asc }])
. EachUserOrderByInput
must have exactly one key, or else an error will be returned. -
#5791
9de71a9fb
Thanks @timleslie! - Changed the return type ofallItems(...)
from[User]
to[User!]
, as this API can never havenull
items in the return array. -
#5769
08478b8a7
Thanks @timleslie! - The GraphQL query_all<Items>Meta { count }
generated for each list has been deprecated in favour of a new query<items>Count
, which directy returns the count.A
User
list would have the following query added to the API:usersCount(where: UserWhereInput! = {}): Int
-
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,a6a444acd
,29075e580
,59421c039
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,0617c81ea
,02af04c03
,107eeb037
,9de71a9fb
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,38a177d61
,bb4f4ac91
,19a756496
]:- @keystone-next/keystone@19.0.0
- @keystone-next/fields@10.0.0
keystone-next-app@1.0.1
Patch Changes
-
#5806
0eadba2ba
Thanks [@list({](https://github.com/list({), [@list({](https://github.com/list({)! - RemovedwithItemData
in favour of asessionData
option to thecreateAuth()
function.Previously,
withItemData
would be used to wrap theconfig.session
argument:import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions, withAuthData } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session: withItemData(session, { User: 'id isAdmin' }), }), }) );
Now, the fields to populate are configured on
sessionData
increateAuth
, andwithItemData
is completely removed.import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', sessionData: 'id isAdmin', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session, }), }) );
-
#5797
a6a444acd
Thanks @timleslie! - The GraphQL field_all<path>Meta { count }
generated formany
relationships has been deprecated in favour of a new field<path>Count
, which directly returns the count.A
posts
relationship field would have the following field added to the API:postsCount(where: PostWhereInput! = {}): Int
-
#5792
319c19bd5
Thanks @timleslie! - Changed the type of thewhere
argument toallItems
to_allItemsMeta
from typeItemWhereInput
toItemWhereInput! = {}
. -
#5850
5b02e8625
Thanks @timleslie! - TheAND
andOR
operators ofItemWhereInput
now accept non-null values, e.g.[ItemWhereInput!]
, rather than[ItemWhereInput]
. -
#5767
02af04c03
Thanks @timleslie! - Deprecated thesortBy
GraphQL filter. Updated theorderBy
GraphQL filter with an improved API.Previously a
User
list'sallUsers
query would have the argument:orderBy: String
The new API gives it the argument:
orderBy: [UserOrderByInput!]! = []
where
input UserOrderByInput { id: OrderDirection name: OrderDirection score: OrderDirection } enum OrderDirection { asc desc }
Rather than writing
allUsers(orderBy: "name_ASC")
you now writeallUsers(orderBy: { name: asc })
. You can also now order by multiple fields, e.g.allUsers(orderBy: [{ score: asc }, { name: asc }])
. EachUserOrderByInput
must have exactly one key, or else an error will be returned. -
#5791
9de71a9fb
Thanks @timleslie! - Changed the return type ofallItems(...)
from[User]
to[User!]
, as this API can never havenull
items in the return array. -
#5769
08478b8a7
Thanks @timleslie! - The GraphQL query_all<Items>Meta { count }
generated for each list has been deprecated in favour of a new query<items>Count
, which directy returns the count.A
User
list would have the following query added to the API:usersCount(where: UserWhereInput! = {}): Int
-
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,5cc35170f
,a6a444acd
,29075e580
,a2553ab82
,59421c039
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,0617c81ea
,02af04c03
,107eeb037
,a0ef39cb3
,9de71a9fb
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,38a177d61
,bb4f4ac91
,19a756496
]:- @keystone-next/auth@26.0.0
- @keystone-next/keystone@19.0.0
- @keystone-next/fields@10.0.0
- @keystone-next/fields-document@6.0.1
@keystone-next/example-roles@4.0.1
Patch Changes
-
#5806
0eadba2ba
Thanks [@list({](https://github.com/list({), [@list({](https://github.com/list({)! - RemovedwithItemData
in favour of asessionData
option to thecreateAuth()
function.Previously,
withItemData
would be used to wrap theconfig.session
argument:import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions, withAuthData } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session: withItemData(session, { User: 'id isAdmin' }), }), }) );
Now, the fields to populate are configured on
sessionData
increateAuth
, andwithItemData
is completely removed.import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions } from '@keystone-next/keystone/session'; import { text, password, checkbox } from '@keystone-next/fields'; import { createAuth } from '@keystone-next/auth'; const { withAuth } = createAuth({ listKey: 'User', identityField: 'email', secretField: 'password', sessionData: 'id isAdmin', }); const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' }); export default withAuth( config({ lists: createSchema({ fields: { email: text({ isUnique: true }), password: password(), isAdmin: checkbox(), }, }), session, }), }) );
-
#5797
a6a444acd
Thanks @timleslie! - The GraphQL field_all<path>Meta { count }
generated formany
relationships has been deprecated in favour of a new field<path>Count
, which directly returns the count.A
posts
relationship field would have the following field added to the API:postsCount(where: PostWhereInput! = {}): Int
-
#5792
319c19bd5
Thanks @timleslie! - Changed the type of thewhere
argument toallItems
to_allItemsMeta
from typeItemWhereInput
toItemWhereInput! = {}
. -
#5850
5b02e8625
Thanks @timleslie! - TheAND
andOR
operators ofItemWhereInput
now accept non-null values, e.g.[ItemWhereInput!]
, rather than[ItemWhereInput]
. -
#5767
02af04c03
Thanks @timleslie! - Deprecated thesortBy
GraphQL filter. Updated theorderBy
GraphQL filter with an improved API.Previously a
User
list'sallUsers
query would have the argument:orderBy: String
The new API gives it the argument:
orderBy: [UserOrderByInput!]! = []
where
input UserOrderByInput { id: OrderDirection name: OrderDirection score: OrderDirection } enum OrderDirection { asc desc }
Rather than writing
allUsers(orderBy: "name_ASC")
you now writeallUsers(orderBy: { name: asc })
. You can also now order by multiple fields, e.g.allUsers(orderBy: [{ score: asc }, { name: asc }])
. EachUserOrderByInput
must have exactly one key, or else an error will be returned. -
#5791
9de71a9fb
Thanks @timleslie! - Changed the return type ofallItems(...)
from[User]
to[User!]
, as this API can never havenull
items in the return array. -
#5769
08478b8a7
Thanks @timleslie! - The GraphQL query_all<Items>Meta { count }
generated for each list has been deprecated in favour of a new query<items>Count
, which directy returns the count.A
User
list would have the following query added to the API:usersCount(where: UserWhereInput! = {}): Int
-
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,a6a444acd
,29075e580
,a2553ab82
,59421c039
,5cc35170f
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,0617c81ea
,02af04c03
,107eeb037
,a0ef39cb3
,9de71a9fb
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,38a177d61
,bb4f4ac91
,19a756496
]:- @keystone-next/auth@26.0.0
- @keystone-next/keystone@19.0.0
- @keystone-next/fields@10.0.0
- @keystone-next/types@19.0.0
@keystone-next/example-sandbox@3.0.1
Patch Changes
-
#5797
a6a444acd
Thanks @timleslie! - The GraphQL field_all<path>Meta { count }
generated formany
relationships has been deprecated in favour of a new field<path>Count
, which directly returns the count.A
posts
relationship field would have the following field added to the API:postsCount(where: PostWhereInput! = {}): Int
-
#5792
319c19bd5
Thanks @timleslie! - Changed the type of thewhere
argument toallItems
to_allItemsMeta
from typeItemWhereInput
toItemWhereInput! = {}
. -
#5850
5b02e8625
Thanks @timleslie! - TheAND
andOR
operators ofItemWhereInput
now accept non-null values, e.g.[ItemWhereInput!]
, rather than[ItemWhereInput]
. -
#5767
02af04c03
Thanks @timleslie! - Deprecated thesortBy
GraphQL filter. Updated theorderBy
GraphQL filter with an improved API.Previously a
User
list'sallUsers
query would have the argument:orderBy: String
The new API gives it the argument:
orderBy: [UserOrderByInput!]! = []
where
input UserOrderByInput { id: OrderDirection name: OrderDirection score: OrderDirection } enum OrderDirection { asc desc }
Rather than writing
allUsers(orderBy: "name_ASC")
you now writeallUsers(orderBy: { name: asc })
. You can also now order by multiple fields, e.g.allUsers(orderBy: [{ score: asc }, { name: asc }])
. EachUserOrderByInput
must have exactly one key, or else an error will be returned. -
#5791
9de71a9fb
Thanks @timleslie! - Changed the return type ofallItems(...)
from[User]
to[User!]
, as this API can never havenull
items in the return array. -
#5769
08478b8a7
Thanks @timleslie! - The GraphQL query_all<Items>Meta { count }
generated for each list has been deprecated in favour of a new query<items>Count
, which directy returns the count.A
User
list would have the following query added to the API:usersCount(where: UserWhereInput! = {}): Int
-
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,a6a444acd
,29075e580
,a2553ab82
,59421c039
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,0617c81ea
,02af04c03
,107eeb037
,a0ef39cb3
,9de71a9fb
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,38a177d61
,bb4f4ac91
,19a756496
]:- @keystone-next/auth@26.0.0
- @keystone-next/keystone@19.0.0
- @keystone-next/fields@10.0.0
@keystone-next/example-blog@2.0.1
Patch Changes
-
#5797
a6a444acd
Thanks @timleslie! - The GraphQL field_all<path>Meta { count }
generated formany
relationships has been deprecated in favour of a new field<path>Count
, which directly returns the count.A
posts
relationship field would have the following field added to the API:postsCount(where: PostWhereInput! = {}): Int
-
#5792
319c19bd5
Thanks @timleslie! - Changed the type of thewhere
argument toallItems
to_allItemsMeta
from typeItemWhereInput
toItemWhereInput! = {}
. -
#5850
5b02e8625
Thanks @timleslie! - TheAND
andOR
operators ofItemWhereInput
now accept non-null values, e.g.[ItemWhereInput!]
, rather than[ItemWhereInput]
. -
#5767
02af04c03
Thanks @timleslie! - Deprecated thesortBy
GraphQL filter. Updated theorderBy
GraphQL filter with an improved API.Previously a
User
list'sallUsers
query would have the argument:orderBy: String
The new API gives it the argument:
orderBy: [UserOrderByInput!]! = []
where
input UserOrderByInput { id: OrderDirection name: OrderDirection score: OrderDirection } enum OrderDirection { asc desc }
Rather than writing
allUsers(orderBy: "name_ASC")
you now writeallUsers(orderBy: { name: asc })
. You can also now order by multiple fields, e.g.allUsers(orderBy: [{ score: asc }, { name: asc }])
. EachUserOrderByInput
must have exactly one key, or else an error will be returned. -
#5791
9de71a9fb
Thanks @timleslie! - Changed the return type ofallItems(...)
from[User]
to[User!]
, as this API can never havenull
items in the return array. -
#5769
08478b8a7
Thanks @timleslie! - The GraphQL query_all<Items>Meta { count }
generated for each list has been deprecated in favour of a new query<items>Count
, which directy returns the count.A
User
list would have the following query added to the API:usersCount(where: UserWhereInput! = {}): Int
-
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,a6a444acd
,29075e580
,59421c039
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,0617c81ea
,02af04c03
,107eeb037
,9de71a9fb
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,38a177d61
,bb4f4ac91
,19a756496
]:- @keystone-next/keystone@19.0.0
- @keystone-next/fields@10.0.0
@keystone-next/example-json-field@4.0.1
Patch Changes
-
#5797
a6a444acd
Thanks @timleslie! - The GraphQL field_all<path>Meta { count }
generated formany
relationships has been deprecated in favour of a new field<path>Count
, which directly returns the count.A
posts
relationship field would have the following field added to the API:postsCount(where: PostWhereInput! = {}): Int
-
#5850
5b02e8625
Thanks @timleslie! - TheAND
andOR
operators ofItemWhereInput
now accept non-null values, e.g.[ItemWhereInput!]
, rather than[ItemWhereInput]
. -
Updated dependencies [
0eadba2ba
,f52079f0b
,b9c828fb0
,74bc77854
,a6a444acd
,29075e580
,59421c039
,319c19bd5
,c6cd0a6bd
,195d4fb12
,1fe4753f3
,5b02e8625
,76cdb791b
,762f17823
,0617c81ea
,02af04c03
,107eeb037
,9de71a9fb
,08478b8a7
,7bda87ea7
,590bb1fe9
,4b11c5ea8
,38a177d61
, [bb4f4ac91
](bb4f4a...