github keystonejs/keystone 2021-06-15
✨ 15th June 2021

latest releases: 2024-04-30, @keystone-6/core@6.1.0, @keystone-6/core@0.0.0-rc-20240429035832...
2 years ago

What's New

Keystone Next now has a new core 🤖, unblocking many of the features you’ve been waiting for!

After months of work deep in the codebase, it’ll be much easier for us to ship roadmap features like custom field types, GraphQL Schema extensions, and more.

⚠️ This release does come with some minor behavioural changes to Keystone’s APIs, read on below.

"@keystone-next/admin-ui-utils": "5.0.2",
"@keystone-next/auth": "27.0.0",
"@keystone-next/cloudinary": "6.0.0",
"@keystone-next/fields-document": "7.0.0",
"@keystone-next/fields": "11.0.0",
"@keystone-next/keystone": "20.0.0",
"@keystone-next/test-utils-legacy": "21.0.0",
"@keystone-next/types": "20.0.0",
"@keystone-next/utils-legacy": "12.0.0",
"@keystone-ui/core": "3.1.0",
"@keystone-ui/fields": "4.1.1",
"@keystone-ui/segmented-control": "4.0.1",

New Core 🤖

The core of Keystone has been re-implemented to make building fields and new features in Keystone easier. While the observable changes for most users should be minimal, there could be breakage 🤖.

⚠️ If you implemented a custom field type, you will need to change it to the new API, see fields in the @keystone-next/fields package for inspiration on how to do this.

Password tweaks 🔒

The password field type now adds a GraphQL type PasswordState to the GraphQL output type instead of adding ${fieldKey}_is_set, exposing a isSet boolean.

type User {
  password: PasswordState
}

type PasswordState {
  isSet: Boolean!
}

Access control operations 👑

List level create, update and delete access control is now called for each operation in a many operation rather than on all of the operations as a whole.

This means that rather than receiving originalInput as an array with itemIds, your access control functions will always be called with just an itemId and/or originalInput (depending on which access control function it is).

⚠️ If your access control functions already worked with creating/updating/deleting one item, they will continue working (though you may get TypeScript errors if you were previously handling itemIds and originalInput as an array, to fix that, you should stop handling that case).

In addition, filters returned from access control now go through GraphQL validation and coercion like filters that you pass in through the GraphQL API, this will produce better errors when you return invalid values.

Virtual field input 🔣

The API to configure virtual fields has changed to accept a field using the schema API exported from @keystone-next/types rather than GraphQL SDL.

Schema reorder 🍡

The ordering of relationships fields in the generated Prisma schema has changed so that it aligns with the order specified in the list config with the opposites to one-sided relationships added at the end.

The name of one-to-one and one-to-many relationships has also changed to include _ between the list key and field key to align with many-to-many relationships.

⚠️ Note that these changes do not require a migration, only your schema.prisma file will need to be updated with keystone-next dev or keystone-next postinstall --fix.

Text and integer filtering 🪡

A long awaited feature, you can now find an item by a unique field! Filtering now works for text and integer fields that have isUnique: true set, for example:

query {
  Post(where: { slug: "something-something-something" }) {
    id
    title
    content
  }
}

UI Accessibility 🏷️

A number of updates have been made in this release to improve accessibility in the Admin UI — updates to the DatePicker labels, relationship fields and more, including visual updates to the segment control (when no value is selected).

Prisma update ⬆️

We've updated our Prisma dependencies to 2.24.1, check out the Prisma releases page for more information.

Enjoying Keystone?

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


View verbose release notes

Releases

@keystone-next/auth@27.0.0

Major Changes

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The core of Keystone has been re-implemented to make implementing fields and new features in Keystone easier. While the observable changes for most users should be minimal, there could be breakage. If you implemented a custom field type, you will need to change it to the new API, see fields in the @keystone-next/fields package for inspiration on how to do this.

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The way that the implementations of generateHash and compare are passed from the password field to auth has changed to be in the extensions object of the GraphQL output field. Unless you've written your own password field implementation or you're using mismatching versions of @keystone-next/auth and @keystone-next/fields, this won't affect you.

Patch Changes

@keystone-next/cloudinary@6.0.0

Major Changes

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The core of Keystone has been re-implemented to make implementing fields and new features in Keystone easier. While the observable changes for most users should be minimal, there could be breakage. If you implemented a custom field type, you will need to change it to the new API, see fields in the @keystone-next/fields package for inspiration on how to do this.

Patch Changes

@keystone-next/fields@11.0.0

Major Changes

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The relationship field now returns a [Item!] instead of a [Item!]!, this is so that if an error occurs when resolving the related items, only the relationship field will be returned as null rather than the whole item being returned as null.

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The API to configure virtual fields has changed to accept a field using the schema API exported from @keystone-next/types rather than GraphQL SDL.

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The core of Keystone has been re-implemented to make implementing fields and new features in Keystone easier. While the observable changes for most users should be minimal, there could be breakage. If you implemented a custom field type, you will need to change it to the new API, see fields in the @keystone-next/fields package for inspiration on how to do this.

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The password field type now adds a GraphQL type PasswordState to the GraphQL output type instead of adding ${fieldKey}_is_set.

    type User {
      password: PasswordState
    }
    
    type PasswordState {
      isSet: Boolean!
    }
  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The way that the implementations of generateHash and compare are passed from the password field to auth has changed to be in the extensions object of the GraphQL output field. Unless you've written your own password field implementation or you're using mismatching versions of @keystone-next/auth and @keystone-next/fields, this won't affect you.

  • #5891 97fd5e05d Thanks @mitchellhamilton! - Added support for filtering uniquely by text and integer fields that have isUnique: true like this:

    query {
      Post(where: { slug: "something-something-something" }) {
        id
        title
        content
      }
    }

Minor Changes

Patch Changes

@keystone-next/fields-document@7.0.0

Major Changes

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The core of Keystone has been re-implemented to make implementing fields and new features in Keystone easier. While the observable changes for most users should be minimal, there could be breakage. If you implemented a custom field type, you will need to change it to the new API, see fields in the @keystone-next/fields package for inspiration on how to do this.

Patch Changes

@keystone-next/keystone@20.0.0

Major Changes

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The ordering of types in the generated schema.graphql has changed due to the re-implementation of the core of Keystone, you will need to run keystone-next dev/keystone-next postinstall --fix to update it.

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - createSystem no longer accepts a Prisma client directly and it returns getKeystone which accepts the generated Prisma client and returns connect, disconnect and createContext instead of returning a keystone instance object.

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The core of Keystone has been re-implemented to make implementing fields and new features in Keystone easier. While the observable changes for most users should be minimal, there could be breakage. If you implemented a custom field type, you will need to change it to the new API, see fields in the @keystone-next/fields package for inspiration on how to do this.

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The ordering of relationships fields in the generated Prisma schema has changed so that it aligns with the order specified in the list config with the opposites to one-sided relationships added at the end. The name of one-to-one and one-to-many relationships has also changed to include _ between the list key and field key to align with many-to-many relationships. Note that these changes do not require a migration, only your schema.prisma file will need to be updated with keystone-next dev/keystone-next postinstall --fix.

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The id field on the item returned from context.db.lists functions/passed to hooks/field type resolvers is now whatever the actual id field returned from Prisma is rather than a stringified version of it.

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - Replaced graphql.itemQueryName with always using the list key as the singular name in GraphQL and renamed graphql.listQueryName to graphql.plural

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The KeystoneContext type no longer has the keystone object or functions to run access control.

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - List level create, update and delete access control is now called for each operation in a many operation rather than on all of the operations as a whole. This means that rather than recieving originalInput as an array with itemIds, your access control functions will always be called with just an itemId and/or originalInput(depending on which access control function it is). If your access control functions already worked with creating/updating/deleting one item, they will continue working (though you may get TypeScript errors if you were previously handling itemIds and originalInput as an array, to fix that, you should stop handling that case).

  • #5891 97fd5e05d Thanks @mitchellhamilton! - Added support for filtering uniquely by text and integer fields that have isUnique: true like this:

    query {
      Post(where: { slug: "something-something-something" }) {
        id
        title
        content
      }
    }
  • #5665 a3b07ea16 Thanks @mitchellhamilton! - Filters returned from access control now go through GraphQL validation and coercion like filters that you pass in through the GraphQL API, this will produce better errors when you return invalid values.

Minor Changes

Patch Changes

@keystone-next/types@20.0.0

Major Changes

  • #5854 7eabb4dee Thanks @rohan-deshpande! - Replaced the types FileMode and ImageMode with AssetMode.

    Added internal experimental Keystone Cloud integration capabilities for images.

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The core of Keystone has been re-implemented to make implementing fields and new features in Keystone easier. While the observable changes for most users should be minimal, there could be breakage. If you implemented a custom field type, you will need to change it to the new API, see fields in the @keystone-next/fields package for inspiration on how to do this.

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - Replaced graphql.itemQueryName with always using the list key as the singular name in GraphQL and renamed graphql.listQueryName to graphql.plural

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - The KeystoneContext type no longer has the keystone object or functions to run access control.

  • #5665 a3b07ea16 Thanks @mitchellhamilton! - List level create, update and delete access control is now called for each operation in a many operation rather than on all of the operations as a whole. This means that rather than recieving originalInput as an array with itemIds, your access control functions will always be called with just an itemId and/or originalInput(depending on which access control function it is). If your access control functions already worked with creating/updating/deleting one item, they will continue working (though you may get TypeScript errors if you were previously handling itemIds and originalInput as an array, to fix that, you should stop handling that case).

  • #5891 97fd5e05d Thanks @mitchellhamilton! - Added support for filtering uniquely by text and integer fields that have isUnique: true like this:

    query {
      Post(where: { slug: "something-something-something" }) {
        id
        title
        content
      }
    }

Minor Changes

Patch Changes

@keystone-next/test-utils-legacy@21.0.0

Major Changes

  • #5883 cf8825bf4 Thanks @timleslie! - Removed the ProviderName type, which is identical to the DatabaseProvider type in @keystone-next/types.
    Added exports for the TestKeystoneConfig and Setup types.

Patch Changes

@keystone-next/utils-legacy@12.0.0

Major Changes

  • #5874 4c90c0d3c Thanks @mitchellhamilton! - Removed the following exports as they're no longer used by Keystone:

    • noop
    • identity
    • getType
    • escapeRegExp
    • mapKeys
    • mapKeyNames
    • resolveAllKeys
    • unique
    • intersection
    • pick
    • omitBy
    • objMerge
    • defaultObj
    • filterValues
    • arrayToObject
    • flatten
    • zipObj
    • mergeWhereClause
    • createLazyDeferred
    • versionGreaterOrEqualTo
    • upcase
    • humanize

Minor Changes

  • #5854 7eabb4dee Thanks @rohan-deshpande! - Replaced the types FileMode and ImageMode with AssetMode.

    Added internal experimental Keystone Cloud integration capabilities for images.

Patch Changes

@keystone-ui/core@3.1.0

Minor Changes

  • #5858 8958704ec Thanks @gwyneplaine! - Added functionality to ensure that Stack elements that are 'ul' or 'ol' automaticaly wrap children in 'li' rather than 'div'.

@keystone-ui/fields@4.1.1

Patch Changes

@keystone-ui/segmented-control@4.0.1

Patch Changes

  • #5886 98482efa4 Thanks @gwyneplaine! - Fixed issue with control looking selected when in neutral state. Added focus ring for better keyboard navigation experience.

  • Updated dependencies [8958704ec]:

    • @keystone-ui/core@3.1.0

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

Patch Changes

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

Major Changes

Minor Changes

Patch Changes

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

Major Changes

Patch Changes

@keystone-next/website@3.1.1

Patch Changes

  • Updated dependencies [df7d7b6f6, a3b07ea16, 8958704ec]:
    • @keystone-ui/fields@4.1.1
    • @keystone-next/fields-document@7.0.0
    • @keystone-ui/core@3.1.0

@keystone-next/example-auth@4.0.2

Patch Changes

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

Patch Changes

@keystone-next/example-ecommerce@4.0.2

Patch Changes

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

Patch Changes

keystone-next-app@1.0.2

Patch Changes

@keystone-next/example-roles@4.0.2

Patch Changes

@keystone-next/example-sandbox@3.0.2

Patch Changes

@keystone-next/example-blog@2.0.2

Patch Changes

@keystone-next/example-default-values@1.0.1

Patch Changes

@keystone-next/example-extend-graphql-schema@1.0.1

Patch Changes

@keystone-next/example-json-field@4.0.2

Patch Changes

@keystone-next/example-task-manager@4.0.2

Patch Changes

@keystone-next/example-with-auth@2.0.2

Patch Changes

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

Patch Changes

@keystone-next/benchmarks-legacy@7.0.2

Patch Changes

Don't miss a new keystone release

NewReleases is sending notifications on new releases.