Skip to content

Releases: keystonejs/keystone

✨ 17th August 2021

17 Aug 05:14
e45c631

Choose a tag to compare

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/[email protected]

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/[email protected]

Major Changes

Read more

✨ 29th July 2021

30 Jul 04:46

Choose a tag to compare

What's New

Custom navigation, pages and logo in this big Admin UI themed release! 🎛️

"@keystone-ui/tooltip": "4.0.1",
"@keystone-next/admin-ui-utils": "5.0.5",
"@keystone-next/auth": "30.0.0",
"@keystone-next/cloudinary": "6.0.5",
"@keystone-next/fields": "13.0.0",
"@keystone-next/fields-document": "7.0.3",
"@keystone-next/keystone": "23.0.2",
"@keystone-next/testing": "1.1.0",
"@keystone-next/types": "23.0.0",
"@keystone-next/utils": "1.0.3",

Custom Admin UI Navigation 🚏

You can now create your own custom navigation component with custom routes to be rendered in the Admin UI.

Check out our detailed Custom Admin UI Navigation guide for all the details!

Custom navigation screenshot

Custom Admin UI Pages 📃

Take things a step further with custom pages. As the Admin UI is built on top of Next.js, it exposes the same /pages directory for adding custom pages.

ℹ️ In the near future you'll be able to directly embed pages within the Keystone Admin UI itself, stay tuned!

Read our new Custom Admin UI Pages guide for more details.

Custom page screenshot

Custom Admin UI Logo 🚩

Wait, theres more. You can also replace the default Admin UI logo with your own brand assets. ✨

Dive into our Custom Admin UI Logo guide to find out how.

Animated logo screenshot

Health Check 💙

We've added an optional /_healthcheck endpoint to Keystone's express server. You can use this endpoint to ensure your Keystone instance is up and running using website monitoring solutions.

Enable it by setting config.server.healthCheck: true, by default it will respond with { status: 'pass', timestamp: Date.now() }.

You can also specify a custom path and JSON data:

config({
  server: {
    healthCheck: {
      path: "/my-health-check",
      data: { status: "healthy" },
    },
  },
});

Or use a function for the data config to return real-time information:

config({
  server: {
    healthCheck: {
      path: "/my-health-check",
      data: () => ({
        status: "healthy",
        timestamp: Date.now(),
        uptime: process.uptime(),
      }),
    },
  },
});

Prisma Update ⬆️

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

Credits 💫

  • Fixed virtual field rendering of false & 0 values thanks to @ChuckJonas!

  • Added / to list.path on HomePage ListCard to better allow custom basePath thanks to @borisno2!

  • Changed symlink generation to use relative path instead of absolute which solves running project in docker when mapping volume, thanks to @gautamsi!

Enjoying Keystone?

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


View verbose release notes

Releases

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #6105 e5f61ad50 Thanks @mitchellhamilton! - Removed unnecessary descriptions on GraphQL types.

  • #6165 e4e6cf9b5 Thanks @mitchellhamilton! - Added ui.searchFields option to lists to allow searching by multiple fields in the Admin UI (the only current usage of this is in the select used in relationship fields) and to replace the usage of the search GraphQL argument which will be removed soon and should be replaced by using contains filters directly.

Patch Changes

@keystone-next/[email protected]

Major Changes

Read more

✨ 13th July 2021

13 Jul 23:31
8eb57b2

Choose a tag to compare

What's New

More examples, types, and UI rendering tweaks as we push forward towards a general availability release! 🚀

"@keystone-ui/core": "3.1.1",
"@keystone-next/admin-ui-utils": "5.0.4",
"@keystone-next/auth": "29.0.0",
"@keystone-next/cloudinary": "6.0.4",
"@keystone-next/document-renderer": "4.0.0",
"@keystone-next/fields": "12.0.0",
"@keystone-next/fields-document": "7.0.2",
"@keystone-next/keystone": "22.0.0",
"@keystone-next/session-store-redis": "3.0.2",
"@keystone-next/testing": "1.0.2",
"@keystone-next/types": "22.0.0",
"@keystone-next/utils": "1.0.2",

New Examples 📖

Custom Field Views

We have a new example for custom field views, demonstrating how to create a custom field view for a JSON field. This example allows users to add, edit and remove navigation items from a list:

image

Inline Relationship in Document Field

Rendering an inline relationship for the document field has been added to the existing example project as well as our docs page:

image

Be sure to check out all the examples, with more to come.

Document Rendering Improvements 📇

If an item referenced in a document field is deleted from Keystone, the document field now handles this gracefully. Before an error would be returned when querying the field, which prevents the user from being able to manage the issue.

This release fixes this to simply return null for the missing item. This also covers the behavior for when a user doesn't have read access for an item.

UI Fixes ⚙️

A variety of UI fixes are in this release when rendering fields in the Admin UI:

  • The value of data passed to the inline relationship renderer now matches the data returned by the GraphQL query.
  • Falsey values of data.label are no longer set to data.id and falsey values of data.data are no longer set to {}.
  • Fixed the relationship name not being passed to the inline relationship renderer.
  • Fixed confusing error when providing fields that don't exist to ui.cardFields, ui.inlineCreate.fields and ui.inlineEdit.fields.
  • Fixed relationship field with displayMode: 'cards' not using labels for related items in the cell view.

Types for KeystoneContext, KeystoneListsAPI and KeystoneDbAPI 🪢

We've added generated types for KeystoneContext, KeystoneListsAPI and KeystoneDbAPI.

You can now import these from .keystone/types (instead of @keystone-next/types) to get types that are pre-bound to your project's schema.

Housekeeping 🧹

Another update for Prisma, version 2.26.0, check out the Prisma releases page for more details.

Our packages-next folder has moved over to packages as part of our push to a general availability release in the near future!

Enjoying Keystone?

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


View verbose release notes

Releases

@keystone-next/[email protected]

Major Changes

  • #6040 890e3d0a5 Thanks @timleslie! - The value of data passed to the inline relationship renderer now matches the data returned by the GraphQL query.
    Falsey values of data.label are no longer set to data.id and falsey values of data.data are no longer set to {}.

Patch Changes

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

Patch Changes

Read more

✨ 30th June 2021

30 Jun 07:28
bb8e11d

Choose a tag to compare

What's New

We've fixed an issue with cloudinaryImage and relationship fields. 🔥

"@keystone-next/auth": "28.0.1",
"@keystone-next/cloudinary": "6.0.3",
"@keystone-next/fields": "11.0.3",
"@keystone-next/keystone": "21.0.2",
"@keystone-next/session-store-redis": "3.0.1",
"@keystone-next/types": "21.0.1",

Field Options Hotfix 🔥

We've discovered an issue where cloudinaryImage and relationship fields were not passing through access control, hooks, ui and graphql options to Keystone, this is now resolved!

Enjoying Keystone?

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


View verbose release notes

Releases

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

  • #6029 038cd09a2 Thanks @bladey! - Updated Keystone URL reference from next.keystonejs.com to keystonejs.com.

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

  • #6029 038cd09a2 Thanks @bladey! - Updated Keystone URL reference from next.keystonejs.com to keystonejs.com.

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

✨ 29th June 2021

29 Jun 07:25
020e210

Choose a tag to compare

What's New

The ID Field option has been revamped with cuid, uuid and autoincrement options! 🤹

"@keystone-next/admin-ui-utils": "5.0.3",
"@keystone-next/auth": "28.0.0",
"@keystone-next/cloudinary@": "6.0.2",
"@keystone-next/fields": "11.0.2",
"@keystone-next/fields-document": "7.0.1",
"@keystone-next/keystone": "21.0.1",
"@keystone-next/testing": "1.0.1",
"@keystone-next/types": "21.0.0",
"@keystone-next/utils": "1.0.1",

New ID Fields 🧮

We've replaced the idField list configuration option with a more constrained option, db.idField.

This option accepts an object with a kind property with a value of:

  • cuid
  • uuid
  • autoincrement

The default behaviour has changed from using autoincrement to using cuids.

To keep the current behaviour, you should set { kind: 'autoincrement' } at db.idField in your top level config.

db.idField can be set on either the top level config object:

config({
  db: {
    idField: { kind: 'uuid' }
  },
  lists,
});

Or on individual lists:

config({
  db,
  lists: createSchema({
    User: list({
      db: {
        idField: { kind: 'uuid' },
      },
      fields: {
        name: text({ isRequired: true }),
      },
    }),
});

Enjoying Keystone?

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


View verbose release notes

Releases

@keystone-next/[email protected]

Major Changes

  • #5947 03f535ba6 Thanks @mitchellhamilton! - Replaced the idField list configuration option with a more constrained option, db.idField, that accepts an object with a kind property with a value of cuid, uuid or autoincrement. db.idField can be set on either the top level config object, or on individual lists.

    The default behaviour has changed from using autoincrement to using cuids. To keep the current behaviour, you should set { kind: 'autoincrement' } at db.idField in your top level config.

  • #5947 03f535ba6 Thanks @mitchellhamilton! - Id field filters no longer allow null to be passed because ids can never be null. For the in and not_in, this is reflected in the GraphQL types

  • #6022 475307e0e Thanks @mitchellhamilton! - Fixed error when loading the Admin UI due to the id field changes.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5947 03f535ba6 Thanks @mitchellhamilton! - Replaced the idField list configuration option with a more constrained option, db.idField, that accepts an object with a kind property with a value of cuid, uuid or autoincrement. db.idField can be set on either the top level config object, or on individual lists.

    The default behaviour has changed from using autoincrement to using cuids. To keep the current behaviour, you should set { kind: 'autoincrement' } at db.idField in your top level config.

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

Read more

✨ 28th June 2021

28 Jun 06:12
235459e

Choose a tag to compare

What's New

An assortment of good things in this release! A new package to help test the behaviour of your GraphQL API, a document field example, better error messages, accessibility updates and another Prisma update! 🍱

"@keystone-ui/fields": "4.1.2",
"@keystone-ui/options": "4.0.1",
"@keystone-ui/pill": "5.0.0",
"@keystone-ui/popover": "4.0.2",
"@keystone-ui/toast": "4.0.1",
"@keystone-next/cloudinary": "6.0.1",
"@keystone-next/fields": "11.0.1",
"@keystone-next/keystone": "20.0.1",
"@keystone-next/testing": "1.0.0",
"@keystone-next/types": "20.0.1",
"@keystone-next/utils": "1.0.0",

Testing Package 🧪

We’ve shipped a new package called @keystone-next/testing to help you write tests for your GraphQL API!

Check out the guide on the Keystone website for more details.

Document Field Example ✍️

We have a new example project for the document field which covers the basic use case of configuring the toolbar, rendering the document field in a front end, and providing custom renderers for the built in data.

Another example showing advanced use cases is in-progress and will be available soon!

Error Messages ❗

GraphQL error messages are far more helpful when running queries. You will now get relevant error messages instead of getting Cannot assign to read only property 'path' of object '#<Object>'" back.

Thanks @tjbp for contributing this fix!

Improved Types for KeystoneContext 📜

⚠️ We've tweaked lists and db.lists APIs on KeystoneContext to have improved types. If you're using the generated KeystoneListsTypeInfo type like this:

const lists: KeystoneListsAPI<KeystoneListsTypeInfo> = context.lists;

You will have to change it to use as like this:

const lists = context.lists as KeystoneListsAPI<KeystoneListsTypeInfo>;

UI Accessibility 🏷️

Another set of accessibility improvements in the Admin UI in this release including assorted quality of life and screen reader improvements to Filter pills and dialogs, as well as labels and descriptions.

Prisma update ⬆️

We've updated our Prisma dependencies to 2.25.0, 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-ui/[email protected]

Major Changes

  • #5987 972e04514 Thanks @gwyneplaine! - Added containerProps prop, these are spread onto the containing element. All other props are now spread onto the internal PillButton component (this change is inclusive of refs).

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-ui/[email protected]

Patch Changes

@keystone-ui/[email protected]

Patch Changes

@keystone-ui/[email protected]

Patch Changes

@keystone-ui/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

Read more

✨ 15th June 2021

15 Jun 05:32
f4193c1

Choose a tag to compare

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/[email protected]

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/[email protected]

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

Read more

✨ 2nd June 2021

02 Jun 05:44
38de10a

Choose a tag to compare

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:

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 nulls 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/[email protected]

Major Changes

  • #5806 0eadba2ba Thanks [@list({](https://github.com/list({), [@list({](https://github.com/list({)! - 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,
        }),
      })
    );
  • #5787 bb4f4ac91 Thanks @timleslie! - Replaced req, session, createContext args to config.ui.pageMiddleware with a context arg.

Patch Changes

Read more

✨ 19th May 2021

19 May 05:42
b464668

Choose a tag to compare

What's New

Node updates 🚀

Node.JS engines in our packages have been updated to 12.x and 14.x to keep up to date with the latest versions of our dependencies.

Admin UI package moved 🚚

@keystone-next/admin-ui now lives inside @keystone-next/keystone/admin-ui.

If you were directly importing from @keystone-next/admin-ui you can now import the same items from @keystone-next/keystone/admin-ui.

⚠️ Please remove references to @keystone-next/admin-ui in your package.json files.

Enjoying Keystone?

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


View verbose release notes

Releases

@keystone-ui/[email protected]

Major Changes

Patch Changes

@keystone-ui/[email protected]

Major Changes

@keystone-ui/[email protected]

Major Changes

Patch Changes

@keystone-ui/[email protected]

Major Changes

Patch Changes

@keystone-ui/[email protected]

Major Changes

Patch Changes

@keystone-ui/[email protected]

Major Changes

Patch Changes

@keystone-ui/[email protected]

Major Changes

Patch Changes

@keystone-ui/[email protected]

Major Changes

Patch Changes

@keystone-ui/[email protected]

Major Changes

Patch Changes

@keystone-ui/[email protected]

Major Changes

Patch Changes

@keystone-ui/[email protected]

Major Changes

Patch Changes

@keystone-ui/[email protected]

Major Changes

Patch Changes

@keystone-ui/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5677 e2232a553 Thanks @timleslie! - Consolidated the @keystone-next/admin-ui package into @keystone-next/keystone.

    If you were directly importing from @keystone-next/admin-ui you can now import the same items from @keystone-next/keystone/admin-ui.
    If you have @keystone-next/admin-ui in your package.json you should remove it.

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5746 19750d2dc Thanks @timleslie! - Update Node.js dependency to ^12.20 || >= 14.13.

  • #5677 e2232a553 Thanks @timleslie! - Consolidated the @keystone-next/admin-ui package into @keystone-next/keystone.

    If you were directly importing from @keystone-next/admin-ui you can now import the same items from @keystone-next/keystone/admin-ui.
    If you have @keystone-next/admin-ui in your package.json you should remove it.

Patch Changes

Read more

✨ 17th May 2021

17 May 02:26
fe6000e

Choose a tag to compare

What's New

Apollo cache hinting can now be configured on a per list or field basis — which can dramatically improve your applications performance 🔥.

Implementing basic authentication? We've got another example using withAuth from the auth package to get you started 🔒.

Focus control is now handled better in the Keystone UI, see the PR for the before and after 👀!

Thanks to @cameronbraid for spotting a session issue and resolving it 🐛.

Enjoying Keystone?

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


View verbose release notes

Releases

@keystone-next/[email protected]

Major Changes

  • #5694 b1baeaba1 Thanks @timleslie! - The Setup type, returned by setupFromConfig and passed into test functions in multiAdapterRunners now has connect and disconnect functions, rather than a keystone object.

Patch Changes

@keystone-ui/[email protected]

Minor Changes

  • #5670 669f0d8ac Thanks @gwyneplaine! - Added focustrap to the PopoverDialog component, when the PopoverDialog is open, browser focus is now trapped within it till the dialog is closed.

@keystone-next/[email protected]

Minor Changes

Patch Changes

@keystone-next/[email protected]

Minor Changes

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

[email protected]

Patch Changes

  • Updated dependencies [[737b3e6e5](h...
Read more