Skip to content

@bladey bladey released this Sep 7, 2021

What's New

Big strides towards our General Availability release for Keystone 6 in the very near future this release includes:

  • New & Improved Access Control API
  • Customisable Express App 🗺️
  • Customisable GraphQL Paths 🚏
  • Faster GraphQL API startups in local dev 🚀
  • Next.js 11 upgrade for Admin UI ⚙️
  • Apollo Server Introspection 🔎
  • Omit GraphQL Operations 🚦
  • And more...

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

"@keystone-next/admin-ui-utils": "6.0.0",
"@keystone-next/auth": "32.0.0",
"@keystone-next/cloudinary": "7.0.0",
"@keystone-next/fields": "15.0.0",
"@keystone-next/fields-document": "9.0.0",
"@keystone-next/keystone": "25.0.1",
"@keystone-next/session-store-redis": "4.0.0",
"@keystone-next/testing": "2.0.0",
"@keystone-next/types": "25.0.0",
"@keystone-next/utils": "2.0.0",

New & Improved Access Control API

⚠️   This includes breaking changes which impact the security of all Keystone systems.

Access Control is now easier to program, and makes it harder to introduce security gaps in your system:

  • The static approach to access control has been replaced. Now access control never effects the operations in your GraphQL API.
  • Keystone used to return an access denied error from a query if an item couldn't be found, or explicitly had access denied. The improved API never returns that error type on a query.
  • Access rules are now more explicit, and support fewer variations so you're less likely to introduce security gaps. They're also easier to read, write, and maintain.

How to upgrade

  1. Follow the instructions in our Access Control upgrade guide.
  2. Review our updated Access Control API docs.

💡 If you get stuck or have questions, reach out to us in the Keystone community slack to get the help you need.

CleanShot 2021-09-07 at 11 40 20

Faster Startup 🚀

The GraphQL API endpoint now starts up significantly faster in development!

Often when you're working with the GraphQL API you'll be waiting around for it to start up, now you don't need to wait for the Admin UI to be ready before hitting the server. The process of creating of the Express Server + GraphQL API has been split from the Admin UI, which significantly speeds up boot time for the GraphQL API in development! 🎉

💡 To facilitate this, createExpressServer no longer includes the step of creating the Admin UI Middleware, which changes its signature. createAdminUIMiddleware is now also exported from @keystone-next/keystone/system.

Next.js 11 ⚙️

We've updated the underlying Next.js server that Keystone uses under the hood from version 10 to 11, which includes optimisations to improve cold startup time.

💡 If you've been using a custom Babel config, you'll need to remove this as it’s no longer supported in Next.js 11.

Omit GraphQL Operations 🚦

You can now add graphql.omit to list and field level configuration to control which types and operations are excluded from the GraphQL API. This option accepts either true, or an array of the values read, create, or update. If you specify true then the field will be excluded from all input and output types in the GraphQL API. If you provide an array of read, create, or update the field will be omitted from the corresponding input and output types in the GraphQL API.

User: list({
  fields: {
    name: text({
      graphql: {
        omit: ['read', 'create', 'update'],
      }
    }),
  },
})

Customisable Express App 🗺️

A long awaited feature, the Express App that Keystone creates is now customisable with the new extendExpressApp option!

  • Add your own custom server routes
  • Host two apps on separate ports
  • And more...

Check out the Server Config docs for more information.

Package Shuffle 💃

We've moved some packages around to make it easier for you to keep your project in sync with Keystone releases, in order to prevent mismatching versions of Keystone packages. The exports from the following packages now reside inside the @keystone-next/keystone/* package:

@keystone-next/admin-ui-utils
@keystone-next/fields
@keystone-next/testing
@keystone-next/types
@keystone-next/utils

For example if you had:

import {
  relationship,
} from '@keystone-next/fields';

This is now:

import {
  relationship,
} from '@keystone-next/keystone/fields';

💡 For any affected package, you'll need to change your import references and remove deprecated packages from your package.json as they will no longer be updated.

Key Changes 🔑

isUnique now isIndex for unique fields 🗂

Unique fields marked as isUnique: true are now represented as isIndexed: 'unique'. This ensures that regular indexes and unique indexes aren't enabled at the same time.

isIndexed accepts the following options as per the Fields API docs -

  • If true then the field will be indexed by the database.
  • If 'unique' then all values of the field must be unique.

fieldPath now fieldKey for field hooks 🪝

The fieldPath argument to field hooks has been renamed to fieldKey. This makes the naming consistent with the Access Control APIs.

schema now graphql for virtual and custom fields 🥽

If you've using Virtual fields or custom field types, or if constructing GraphQL types, we used to export schema, this has been changed to graphql.

Disabled filtering and ordering (by default) 🙅‍♀️

Filtering and ordering is no longer enabled by default, as they have the potential to expose data which would otherwise be protected by access control. To enable filtering and ordering you can set isFilterable: true and isOrderable: true on specific fields, or set defaultIsFilterable: true and defaultIsOrderable: true at the list level.

Check out our Fields API docs for all field level options.

Introspection 🔎

You can now enable introspection in the Apollo Server config. Introspection enables you to query a GraphQL server for information about the underlying schema. Check out the GraphQL Config docs for more information.

GraphQL Path Customisation 🚏

The GraphQL endpoint accessible by default at /api/graphql can now be customised with the new option config.graphql.path. You can find this and all other options in our GraphQL API docs.

Admin UI Improvements 🛠️

The Navigation component has been updated to show docs and playground links irrespective of authentication. The triple-dot menu is now available in the Admin UI even if authentication isn't being used.

CleanShot 2021-09-07 at 13 22 30

Additionally, performance has been improved of the create item modal when many fields are configured. Thanks to Sam Lam for the heads up!

Prisma Update ⬆️

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

Credits 💫

  • Fixed an issue in the Relationship field when using display mode count, thanks to @gautamsi!
  • Sam Lam for alerting us to performance issues with Admin UI create item modal.

Enjoying Keystone?

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

View verbose release notes

Releases

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

Major Changes

@keystone-next/auth@32.0.0

Major Changes

Patch Changes

@keystone-next/cloudinary@7.0.0

Major Changes

Patch Changes

@keystone-next/fields@15.0.0

Major Changes

@keystone-next/fields-document@9.0.0

Major Changes

Patch Changes

@keystone-next/keystone@25.0.0

Major Changes

  • #6377 3008c5110 Thanks @mitchellhamilton! - Moved exports of @keystone-next/keystone to @keystone-next/keystone/system

  • #6323 3904a9cf7 Thanks @mitchellhamilton! - Removed unused legacy filter code

  • #6414 32f024738 Thanks @mitchellhamilton! - Updated to Next.js 11. If you were using a custom Babel config, it will no longer be respected because of changes in Next.js.

  • #6393 ee54522d5 Thanks @mitchellhamilton! - Updated @graphql-ts/schema to 0.3.0 and moved the schema export to @keystone-next/keystone entrypoint and renamed it to graphql. bindSchemaAPIToContext on the graphql export has also been renamed to bindGraphQLSchemaAPIToContext.

  • #6426 8f2786535 Thanks @timleslie! - Update the Access Control API. This is a breaking change which impacts the security of all Keystone systems.

    See the Access Control API for a full description of the new API.

  • #6420 0aa02a333 Thanks @timleslie! - Added the config option graphql.omit to list and field level configuration to control which types and operations are excluded from the GraphQL API. The use of a static false value in access control definitions no longer excludes operations from the GraphQL API.

  • #6455 bf9b5605f Thanks @timleslie! - The fieldPath argument to field hooks has been renamed to fieldKey. This makes the naming consistent with the Access Control APIs.

  • #6463 3957c0981 Thanks @JedWatson! - The GraphQL API endpoint now starts up significantly faster in Dev.

    To facilitate this, createExpressServer no longer includes the step of creating the Admin UI Middleware, which changes its signature. createAdminUIMiddleware is now also exported from @keystone-next/keystone/system.

  • #6437 af5e59bf4 Thanks @mitchellhamilton! - Changed isUnique: true config in fields to isIndexed: 'unique'

  • #6420 0aa02a333 Thanks @timleslie! - Filtering and ordering is no longer enabled by default, as they have the potential to expose data which would otherwise be protected by access control. To enable filtering and ordering you can set isFilterable: true and isOrderable: true on specific fields, or set defaultIsFilterable: true and defaultIsOrderable: true at the list level.

  • #6378 489e128fe Thanks @mitchellhamilton! - Moved exports of @keystone-next/keystone/schema to @keystone-next/keystone

Minor Changes

  • #6403 2a901a121 Thanks @timleslie! - Added the experimental config option config.experimental.contextInitialisedLists, which adds the internal data structure experimental.initialisedLists to the context object. This is a temporary addition to the API which will be removed in a future release once a more controlled API is available. It should be used with caution, as it will contain breaking change in patch level releases.

  • #6371 44f2ef60e Thanks @mitchellhamilton! - Moved @keystone-next/types to @keystone-next/keystone/types

  • #6367 4f36a81af Thanks @mitchellhamilton! - Moved @keystone-next/admin-ui-utils to @keystone-next/keystone/admin-ui/utils

  • #6361 595922b48 Thanks @mitchellhamilton! - Moved exports of @keystone-next/testing to @keystone-next/keystone/testing

  • #6368 783290796 Thanks @mitchellhamilton! - Moved @keystone-next/utils to @keystone-next/keystone/fields/types/image/utils for image ref related utilities and @keystone-next/keystone/fields/types/file/utils for file ref related utilities.

  • #6458 944bce1e8 Thanks @timleslie! - Added the config option config.graphql.path to configure the endpoint of the GraphQL API (default '/api/graphql').

  • #6467 e0f935eb2 Thanks @JedWatson! - Add extendExpressApp config option for configuring the express app that Keystone creates

  • #6459 f2311781a Thanks @timleslie! - Updated Navigation component to show docs and playground links irrespective of authentication.

  • #6362 fd744dcaa Thanks @mitchellhamilton! - Moved @keystone-next/fields to @keystone-next/keystone/fields

Patch Changes

  • #6390 2e3f3666b Thanks @mitchellhamilton! - Improved performance of create item modal with many fields

  • #6385 9651aff8e Thanks @gautamsi! - Fixed issue in Relationship field display mode 'count'. It was using _fieldnameMeta.count instead of fieldnameCount

  • #6422 9c5991f43 Thanks @timleslie! - Made cosmetic changes to the Admin UI code. No functional changes.

  • #6453 069265b9c Thanks @gwyneplaine! - Dashboard cards now enclosed in unordered list, for clearer semantics.

  • #6397 c76bfc0a2 Thanks @mitchellhamilton! - Added a comment in the schema.prisma and schema.graphql files explaining that they're generated and should not be modified manually.

  • #6391 bc9088f05 Thanks @bladey! - Adds support for introspection in the Apollo Server config. Introspection enables you to query a GraphQL server for information about the underlying schema. If the playground is enabled then introspection is automatically enabled - unless specifically disabled.

  • #6414 32f024738 Thanks @mitchellhamilton! - Updated usages of jsx from @keystone-ui/core to explicitly use /** @jsxRuntime classic */

  • #6392 bd120c7c2 Thanks @mitchellhamilton! - Fixed negative take values above the list's graphql.queryLimits.maxResults not causing an error before getting the values from the database.

  • #6381 b3eefc1c3 Thanks @mitchellhamilton! - Fixed error from prisma when using .keystone/api from generateNodeAPI in a API route (admin/pages/api/*)

  • #6429 cbc5a68aa Thanks @timleslie! - Update adminMeta fieldMode resolvers to respect graphql.omit configuration.

  • #6414 32f024738 Thanks @mitchellhamilton! - Changed the way the package directory for resolving views is obtained to use __dirname rather than require.resolve('pkg/package.json') because in Next.js 11 require.resolve returns a numeric id instead of the path.

  • #6432 0a189d5d0 Thanks @renovate! - Updated typescript dependency to ^4.4.2.

  • #6412 2324fa027 Thanks @gwyneplaine! - Merged aria-description text for dialogs on list view in Admin UI into their respective aria-labels.

  • #6462 88b03bd79 Thanks @JedWatson! - Fixed crashing the process when createContext() fails for Admin UI requests

  • #6354 5ceccd821 Thanks @gwyneplaine! - Fixed Listview checkbox bug in a better way.

  • #6433 bb0c6c626 Thanks @renovate! - Updated Prisma dependencies to 2.30.2.

  • Updated dependencies [32f024738, 069265b9c]:

    • @keystone-ui/button@5.0.1
    • @keystone-ui/core@3.2.0
    • @keystone-ui/fields@4.1.3
    • @keystone-ui/icons@4.0.1
    • @keystone-ui/loading@4.0.1
    • @keystone-ui/modals@4.0.1
    • @keystone-ui/notice@4.0.2
    • @keystone-ui/options@4.0.2
    • @keystone-ui/pill@5.0.1
    • @keystone-ui/popover@4.0.3
    • @keystone-ui/segmented-control@4.0.3
    • @keystone-ui/toast@4.0.3
    • @keystone-ui/tooltip@4.0.2

@keystone-next/session-store-redis@4.0.0

Major Changes

Patch Changes

@keystone-next/testing@2.0.0

Major Changes

@keystone-next/types@25.0.0

Major Changes

@keystone-next/utils@2.0.0

Major Changes

  • #6368 783290796 Thanks @mitchellhamilton! - Moved @keystone-next/utils to @keystone-next/keystone/fields/types/image/utils for image ref related utilities and @keystone-next/keystone/fields/types/file/utils for file ref related utilities.

@keystone-ui/core@3.2.0

Minor Changes

  • #6453 069265b9c Thanks @gwyneplaine! - Added functionality to ensure that Inline elements that are 'ul' or 'ol' automatically wrap children in 'li' rather than 'div'

Patch Changes

@keystone-ui/button@5.0.1

Patch Changes

  • #6414 32f024738 Thanks @mitchellhamilton! - Updated usages of jsx from @keystone-ui/core to explicitly use /** @jsxRuntime classic */

  • Updated dependencies [32f024738, 069265b9c]:

    • @keystone-ui/core@3.2.0
    • @keystone-ui/icons@4.0.1
    • @keystone-ui/loading@4.0.1

@keystone-ui/fields@4.1.3

Patch Changes

  • #6414 32f024738 Thanks @mitchellhamilton! - Updated usages of jsx from @keystone-ui/core to explicitly use /** @jsxRuntime classic */

  • Updated dependencies [32f024738, 069265b9c]:

    • @keystone-ui/core@3.2.0
    • @keystone-ui/icons@4.0.1
    • @keystone-ui/popover@4.0.3

@keystone-ui/icons@4.0.1

Patch Changes

@keystone-ui/loading@4.0.1

Patch Changes

@keystone-ui/modals@4.0.1

Patch Changes

@keystone-ui/notice@4.0.2

Patch Changes

  • #6414 32f024738 Thanks @mitchellhamilton! - Updated usages of jsx from @keystone-ui/core to explicitly use /** @jsxRuntime classic */

  • Updated dependencies [32f024738, 069265b9c]:

    • @keystone-ui/button@5.0.1
    • @keystone-ui/core@3.2.0
    • @keystone-ui/icons@4.0.1

@keystone-ui/options@4.0.2

Patch Changes

  • #6414 32f024738 Thanks @mitchellhamilton! - Updated usages of jsx from @keystone-ui/core to explicitly use /** @jsxRuntime classic */

  • Updated dependencies [32f024738, 069265b9c]:

    • @keystone-ui/core@3.2.0
    • @keystone-ui/fields@4.1.3
    • @keystone-ui/icons@4.0.1

@keystone-ui/pill@5.0.1

Patch Changes

@keystone-ui/popover@4.0.3

Patch Changes

@keystone-ui/segmented-control@4.0.3

Patch Changes

@keystone-ui/toast@4.0.3

Patch Changes

@keystone-ui/tooltip@4.0.2

Patch Changes

@keystone-ui/website@3.0.2

Patch Changes

  • #6443 b45536e22 Thanks @timleslie! - Removed unused dependency @types/webpack.

  • #6432 0a189d5d0 Thanks @renovate! - Updated typescript dependency to ^4.4.2.

  • Updated dependencies [32f024738, 069265b9c]:

    • @keystone-ui/button@5.0.1
    • @keystone-ui/core@3.2.0
    • @keystone-ui/fields@4.1.3
    • @keystone-ui/loading@4.0.1
    • @keystone-ui/modals@4.0.1
    • @keystone-ui/notice@4.0.2
    • @keystone-ui/options@4.0.2
    • @keystone-ui/pill@5.0.1
    • @keystone-ui/popover@4.0.3
    • @keystone-ui/segmented-control@4.0.3
    • @keystone-ui/toast@4.0.3
    • @keystone-ui/tooltip@4.0.2

@keystone-next/website@3.1.5

Patch Changes

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

Patch Changes

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

Patch Changes

@keystone-next/example-auth@4.0.7

Patch Changes

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

Patch Changes

@keystone-next/example-ecommerce@4.0.8

Patch Changes

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

Patch Changes

keystone-next-app@1.0.7

Patch Changes

@keystone-next/example-playground@1.0.6

Patch Changes

@keystone-next/example-roles@4.0.7

Patch Changes

@keystone-next/example-sandbox@3.0.7

Patch Changes

@keystone-next/example-blog@2.0.7

Patch Changes

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

Patch Changes

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

Patch Changes

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

Patch Changes

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

Patch Changes

@keystone-next/example-custom-field-view@1.0.3

Patch Changes

Contributors
timleslie, bladey, and 6 other contributors
Assets 2