Skip to content

✨ 17th August 2021

Compare
Choose a tag to compare
@bladey bladey released this 17 Aug 05:14
e45c631

What's New

A major milestone in the path to a General Availability status for Keystone 6, this release includes:

  • A new and improved GraphQL API 🎉 ✨
  • Enhancements to Custom Admin UI Pages
  • Better deletion notifications
  • And more…

⚠️   This release contains breaking changes, please see below!

"@keystone-ui/notice": "4.0.1",
"@keystone-ui/segmented-control": "4.0.2",
"@keystone-ui/toast": "4.0.2",
"@keystone-next/admin-ui-utils": "5.0.6",
"@keystone-next/auth": "31.0.0",
"@keystone-next/cloudinary": "6.0.6",
"@keystone-next/fields": "14.0.0",
"@keystone-next/fields-document": "8.0.0",
"@keystone-next/keystone": "24.0.0",
"@keystone-next/testing": "1.1.1",
"@keystone-next/types": "24.0.0",
"@keystone-next/utils": "1.0.4",

A new & improved GraphQL API ✨

We’ve made the experience of working with Keystone’s GraphQL API easier to program and reason about:

  • Queries: the names of top-level queries are now easier to understand. We also removed deprecated and unused legacy features.
  • Filters: the arguments used in queries have been updated to accept a filter object for each field, rather than having all the filter options available at the top level.
  • Mutations: all generated CRUD mutations have the same names and return types, but their inputs have changed.
  • Input Types: we’ve updated the input types used for relationship fields in update and create operations, removing obsolete options and making the syntax between the two operations easier to differentiate.

Upgrade guidance

We've written a complete guide to the improvements we've made, and it includes a checklist of the steps you need to take to upgrade your Keystone projects. Be sure to check it out!

💡 While there are a lot of changes to this API, if you approach the upgrade process systematically your experience should be pretty smooth. If you get stuck or have questions, reach out to us in the Keystone community slack to get the help you need.

Screen Shot 2021-08-17 at 11 28 56 am

Custom Admin UI Pages 📃

Our Custom Admin UI Pages guide has been expanded, with an example to make your custom pages look more like the Admin UI, as well as adding links to your custom pages from the Admin UI Navigation!

Screen Shot 2021-08-17 at 11 30 39 am

Improved Deletion Notifications 🗑

When items are deleted via the Admin UI, we now display all the items that were successfully deleted, and any that failed, instead of displaying multiple notifications without any context.

Screen Shot 2021-08-17 at 11 04 47 am

Deeper GraphQL Errors 🚧

A config.graphql.debug option has been added, which can be used to control whether debug information such as stack traces are included in the errors returned by the GraphQL API.

Prisma Update ⬆️

Updated Prisma dependencies from 2.27.0 to 2.29.0, check out the Prisma releases page for more details.

Credits 💫

Added option for Bearer token auth when using session, thanks to @gautamsi!

Enjoying Keystone?

Star this repo 🌟 ☝️ or connect to Keystone on Twitter and in Slack.

View verbose release notes

Releases

@keystone-next/auth@31.0.0

Major Changes

  • #6211 d214e2f72 Thanks @mitchellhamilton! - The update mutations now accept where unique inputs instead of only an id and the where and data arguments are non-null.

    If you have a list called Item, the update mutations now look like this:

    type Mutation {
      updateItem(where: ItemWhereUniqueInput!, data: ItemUpdateInput!): Item
      updateItems(data: [ItemUpdateArgs!]!): [Item]
    }
    
    input ItemUpdateArgs {
      where: ItemWhereUniqueInput!
      data: ItemUpdateInput!
    }

Patch Changes

@keystone-next/fields@14.0.0

Major Changes

  • #6280 e9f3c42d5 Thanks @mitchellhamilton! - Removed gqlType option to autoIncrement field type. The field type will now always be represented with an Int in GraphQL

  • #6196 5cd8ffd6c Thanks @mitchellhamilton! - Removed _ListKeyMeta and _toManyRelationshipFieldMeta fields. You should use listKeyCount and toManyRelationshipFieldCount instead

  • #6266 b696a9579 Thanks @mitchellhamilton! - Renamed first argument in find many queries to take to align with Prisma.

    type Query {
      users(
        where: UserWhereInput! = {}
        orderBy: [UserOrderByInput!]! = []
        # previously was first: Int
        take: Int
        skip: Int! = 0
      ): [User!]
      # ...
    }
    
    type User {
      # ...
      posts(
        where: PostWhereInput! = {}
        orderBy: [PostOrderByInput!]! = []
        # previously was first: Int
        take: Int
        skip: Int! = 0
      ): [Post!]
      # ...
    }
  • #6196 5cd8ffd6c Thanks @mitchellhamilton! - 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.

  • #6095 272b97b3a Thanks @mitchellhamilton! - Updated filters to be nested instead of flattened and add top-level NOT operator. See the Query Filter API docs and the upgrade guide for more information.

    query {
      posts(where: { title: { contains: "Something" } }) {
        title
        content
      }
    }
  • #6196 5cd8ffd6c Thanks @mitchellhamilton! - Removed sortBy argument from the GraphQL API for finding many items, Lists/DB API and to-many relationship fields. You should use orderBy instead.

  • #6217 874f2c405 Thanks @mitchellhamilton! - disconnectAll has been renamed to disconnect in to-one relationship inputs and the old disconnect field has been removed. There are also seperate input types for create and update where the input for create doesn't have disconnect. It's also now required that if you provide a to-one relationship input, you must provide exactly one field to the input.

    If you have a list called Item, the to-one relationship inputs now look like this:

    input ItemRelateToOneForCreateInput {
      create: ItemCreateInput
      connect: ItemWhereUniqueInput
    }
    input ItemRelateToOneForUpdateInput {
      create: ItemCreateInput
      connect: ItemWhereUniqueInput
      disconnect: Boolean
    }
  • #6224 3564b342d Thanks @mitchellhamilton! - disconnectAll has been replaced by set in to-many relationship inputs, the equivalent to disconnectAll: true is now set: []. There are also seperate input types for create and update where the input for create doesn't have disconnect or set. The inputs in the lists in the input field are now also non-null.

    If you have a list called Item, the to-many relationship inputs now look like this:

    input ItemRelateToManyForCreateInput {
      create: [ItemCreateInput!]
      connect: [ItemWhereUniqueInput!]
    }
    input ItemRelateToManyForUpdateInput {
      disconnect: [ItemWhereUniqueInput!]
      set: [ItemWhereUniqueInput!]
      create: [ItemCreateInput!]
      connect: [ItemWhereUniqueInput!]
    }
  • #6211 d214e2f72 Thanks @mitchellhamilton! - The update mutations now accept where unique inputs instead of only an id and the where and data arguments are non-null.

    If you have a list called Item, the update mutations now look like this:

    type Mutation {
      updateItem(where: ItemWhereUniqueInput!, data: ItemUpdateInput!): Item
      updateItems(data: [ItemUpdateArgs!]!): [Item]
    }
    
    input ItemUpdateArgs {
      where: ItemWhereUniqueInput!
      data: ItemUpdateInput!
    }

Patch Changes

@keystone-next/fields-document@8.0.0

Major Changes

  • #6095 272b97b3a Thanks @mitchellhamilton! - Updated filters to be nested instead of flattened and add top-level NOT operator. See the Query Filter API docs and the upgrade guide for more information.

    query {
      posts(where: { title: { contains: "Something" } }) {
        title
        content
      }
    }

Patch Changes

@keystone-next/keystone@24.0.0

Major Changes

  • #6196 5cd8ffd6c Thanks @mitchellhamilton! - Removed _ListKeyMeta and _toManyRelationshipFieldMeta fields. You should use listKeyCount and toManyRelationshipFieldCount instead

  • #6196 5cd8ffd6c Thanks @mitchellhamilton! - Removed all arguments from context.lists.List.count and context.db.lists.List.count except for where.

  • #6266 b696a9579 Thanks @mitchellhamilton! - Renamed first argument in find many queries to take to align with Prisma.

    type Query {
      users(
        where: UserWhereInput! = {}
        orderBy: [UserOrderByInput!]! = []
        # previously was first: Int
        take: Int
        skip: Int! = 0
      ): [User!]
      # ...
    }
    
    type User {
      # ...
      posts(
        where: PostWhereInput! = {}
        orderBy: [PostOrderByInput!]! = []
        # previously was first: Int
        take: Int
        skip: Int! = 0
      ): [Post!]
      # ...
    }
  • #6208 092df6678 Thanks @mitchellhamilton! - The create one mutation now requires a non-null data argument and the create many mutation accepts a list of ItemCreateInput directly instead of being nested inside of an object with the ItemCreateInput in a data field.

    If you have a list called Item, createItem now looks like createItem(data: ItemCreateInput!): Item and createItems now looks like createItems(data: [ItemCreateInput!]!): [Item].

  • #6196 5cd8ffd6c Thanks @mitchellhamilton! - 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.

  • #6095 272b97b3a Thanks @mitchellhamilton! - Updated filters to be nested instead of flattened and add top-level NOT operator. See the Query Filter API docs and the upgrade guide for more information.

    query {
      posts(where: { title: { contains: "Something" } }) {
        title
        content
      }
    }
  • #6198 9d361c1c8 Thanks @timleslie! - Removed the uid and name properties from the errors returned by the GraphQL API.

  • #6196 5cd8ffd6c Thanks @mitchellhamilton! - Removed sortBy argument from the GraphQL API for finding many items, Lists/DB API and to-many relationship fields. You should use orderBy instead.

  • #6312 56044e2a4 Thanks @mitchellhamilton! - Updated @graphql-ts/schema. The second type parameter of schema.Arg exported from @keystone-next/types is now a boolean that defines whether or not the arg has a default value to make it easier to define circular input objects.

  • #6217 874f2c405 Thanks @mitchellhamilton! - disconnectAll has been renamed to disconnect in to-one relationship inputs and the old disconnect field has been removed. There are also seperate input types for create and update where the input for create doesn't have disconnect. It's also now required that if you provide a to-one relationship input, you must provide exactly one field to the input.

    If you have a list called Item, the to-one relationship inputs now look like this:

    input ItemRelateToOneForCreateInput {
      create: ItemCreateInput
      connect: ItemWhereUniqueInput
    }
    input ItemRelateToOneForUpdateInput {
      create: ItemCreateInput
      connect: ItemWhereUniqueInput
      disconnect: Boolean
    }
  • #6224 3564b342d Thanks @mitchellhamilton! - disconnectAll has been replaced by set in to-many relationship inputs, the equivalent to disconnectAll: true is now set: []. There are also seperate input types for create and update where the input for create doesn't have disconnect or set. The inputs in the lists in the input field are now also non-null.

    If you have a list called Item, the to-many relationship inputs now look like this:

    input ItemRelateToManyForCreateInput {
      create: [ItemCreateInput!]
      connect: [ItemWhereUniqueInput!]
    }
    input ItemRelateToManyForUpdateInput {
      disconnect: [ItemWhereUniqueInput!]
      set: [ItemWhereUniqueInput!]
      create: [ItemCreateInput!]
      connect: [ItemWhereUniqueInput!]
    }
  • #6197 4d9f89f88 Thanks @mitchellhamilton! - The generated CRUD queries, and some of the input types, in the GraphQL API have been renamed.

    If you have a list called Item, the query for multiple values, allItems will be renamed to items. The query for a single value, Item, will be renamed to item.

    Also, the input type used in the updateItems mutation has been renamed from ItemsUpdateInput to ItemUpdateArgs.

  • #6211 d214e2f72 Thanks @mitchellhamilton! - The update mutations now accept where unique inputs instead of only an id and the where and data arguments are non-null.

    If you have a list called Item, the update mutations now look like this:

    type Mutation {
      updateItem(where: ItemWhereUniqueInput!, data: ItemUpdateInput!): Item
      updateItems(data: [ItemUpdateArgs!]!): [Item]
    }
    
    input ItemUpdateArgs {
      where: ItemWhereUniqueInput!
      data: ItemUpdateInput!
    }
  • #6206 f5e64af37 Thanks @mitchellhamilton! - The delete mutations now accept where unique inputs instead of only an id.

    If you have a list called Item, deleteItem now looks like deleteItem(where: ItemWhereUniqueInput!): Item and deleteItems now looks like deleteItems(where: [ItemWhereUniqueInput!]!): [Item]

Minor Changes

  • #6276 3a7a06b2c Thanks @gautamsi! - Added option for Bearer token auth when using session.

  • #6267 1030296d1 Thanks @timleslie! - Added config.graphql.debug option, which can be used to control whether debug information such as stack traces are included in the errors returned by the GraphQL API.

Patch Changes

@keystone-next/types@24.0.0

Major Changes

  • #6196 5cd8ffd6c Thanks @mitchellhamilton! - Removed _ListKeyMeta and _toManyRelationshipFieldMeta fields. You should use listKeyCount and toManyRelationshipFieldCount instead

  • #6196 5cd8ffd6c Thanks @mitchellhamilton! - Removed all arguments from context.lists.List.count and context.db.lists.List.count except for where.

  • #6266 b696a9579 Thanks @mitchellhamilton! - Renamed first argument in find many queries to take to align with Prisma.

    type Query {
      users(
        where: UserWhereInput! = {}
        orderBy: [UserOrderByInput!]! = []
        # previously was first: Int
        take: Int
        skip: Int! = 0
      ): [User!]
      # ...
    }
    
    type User {
      # ...
      posts(
        where: PostWhereInput! = {}
        orderBy: [PostOrderByInput!]! = []
        # previously was first: Int
        take: Int
        skip: Int! = 0
      ): [Post!]
      # ...
    }
  • #6208 092df6678 Thanks @mitchellhamilton! - The create one mutation now requires a non-null data argument and the create many mutation accepts a list of ItemCreateInput directly instead of being nested inside of an object with the ItemCreateInput in a data field.

    If you have a list called Item, createItem now looks like createItem(data: ItemCreateInput!): Item and createItems now looks like createItems(data: [ItemCreateInput!]!): [Item].

  • #6196 5cd8ffd6c Thanks @mitchellhamilton! - 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.

  • #6095 272b97b3a Thanks @mitchellhamilton! - Updated filters to be nested instead of flattened and add top-level NOT operator. See the Query Filter API docs and the upgrade guide for more information.

    query {
      posts(where: { title: { contains: "Something" } }) {
        title
        content
      }
    }
  • #6196 5cd8ffd6c Thanks @mitchellhamilton! - Removed sortBy argument from the GraphQL API for finding many items, Lists/DB API and to-many relationship fields. You should use orderBy instead.

  • #6312 56044e2a4 Thanks @mitchellhamilton! - Updated @graphql-ts/schema. The second type parameter of schema.Arg exported from @keystone-next/types is now a boolean that defines whether or not the arg has a default value to make it easier to define circular input objects.

  • #6217 874f2c405 Thanks @mitchellhamilton! - disconnectAll has been renamed to disconnect in to-one relationship inputs and the old disconnect field has been removed. There are also seperate input types for create and update where the input for create doesn't have disconnect. It's also now required that if you provide a to-one relationship input, you must provide exactly one field to the input.

    If you have a list called Item, the to-one relationship inputs now look like this:

    input ItemRelateToOneForCreateInput {
      create: ItemCreateInput
      connect: ItemWhereUniqueInput
    }
    input ItemRelateToOneForUpdateInput {
      create: ItemCreateInput
      connect: ItemWhereUniqueInput
      disconnect: Boolean
    }
  • #6224 3564b342d Thanks @mitchellhamilton! - disconnectAll has been replaced by set in to-many relationship inputs, the equivalent to disconnectAll: true is now set: []. There are also seperate input types for create and update where the input for create doesn't have disconnect or set. The inputs in the lists in the input field are now also non-null.

    If you have a list called Item, the to-many relationship inputs now look like this:

    input ItemRelateToManyForCreateInput {
      create: [ItemCreateInput!]
      connect: [ItemWhereUniqueInput!]
    }
    input ItemRelateToManyForUpdateInput {
      disconnect: [ItemWhereUniqueInput!]
      set: [ItemWhereUniqueInput!]
      create: [ItemCreateInput!]
      connect: [ItemWhereUniqueInput!]
    }
  • #6197 4d9f89f88 Thanks @mitchellhamilton! - The generated CRUD queries, and some of the input types, in the GraphQL API have been renamed.

    If you have a list called Item, the query for multiple values, allItems will be renamed to items. The query for a single value, Item, will be renamed to item.

    Also, the input type used in the updateItems mutation has been renamed from ItemsUpdateInput to ItemUpdateArgs.

  • #6211 d214e2f72 Thanks @mitchellhamilton! - The update mutations now accept where unique inputs instead of only an id and the where and data arguments are non-null.

    If you have a list called Item, the update mutations now look like this:

    type Mutation {
      updateItem(where: ItemWhereUniqueInput!, data: ItemUpdateInput!): Item
      updateItems(data: [ItemUpdateArgs!]!): [Item]
    }
    
    input ItemUpdateArgs {
      where: ItemWhereUniqueInput!
      data: ItemUpdateInput!
    }
  • #6206 f5e64af37 Thanks @mitchellhamilton! - The delete mutations now accept where unique inputs instead of only an id.

    If you have a list called Item, deleteItem now looks like deleteItem(where: ItemWhereUniqueInput!): Item and deleteItems now looks like deleteItems(where: [ItemWhereUniqueInput!]!): [Item]

Minor Changes

  • #6267 1030296d1 Thanks @timleslie! - Added config.graphql.debug option, which can be used to control whether debug information such as stack traces are included in the errors returned by the GraphQL API.

Patch Changes

@keystone-ui/notice@4.0.1

Patch Changes

@keystone-ui/segmented-control@4.0.2

Patch Changes

@keystone-ui/toast@4.0.2

Patch Changes

@keystone-next/admin-ui-utils@5.0.6

Patch Changes

@keystone-next/cloudinary@6.0.6

Patch Changes

@keystone-next/testing@1.1.1

Patch Changes

@keystone-next/utils@1.0.4

Patch Changes

@keystone-next/example-custom-admin-ui-navigation@5.0.0

Major Changes

Patch Changes

@keystone-next/example-custom-admin-ui-pages@1.0.0

Major Changes

Patch Changes

@keystone-next/api-tests-legacy@11.1.0

Minor Changes

Patch Changes

@keystone-next/website@3.1.4

Patch Changes

@keystone-next/example-assets-cloud@1.0.4

Patch Changes

@keystone-next/example-assets-local@1.0.4

Patch Changes

@keystone-next/example-auth@4.0.6

Patch Changes

@keystone-next/examples-app-basic@4.0.6

Patch Changes

@keystone-next/example-ecommerce@4.0.7

Patch Changes

@keystone-next/example-embedded-nextjs@3.0.6

Patch Changes

keystone-next-app@1.0.6

Patch Changes

@keystone-next/example-playground@1.0.5

Patch Changes

@keystone-next/example-roles@4.0.6

Patch Changes

@keystone-next/example-sandbox@3.0.6

Patch Changes

@keystone-next/example-blog@2.0.6

Patch Changes

@keystone-next/example-custom-admin-ui-logo@1.0.1

Patch Changes

@keystone-next/example-custom-field@0.0.3

Patch Changes