keystone

The superpowered headless CMS for Node.js — built with GraphQL and React

MIT License

Downloads
1M
Stars
9.2K
Committers
270

Bot releases are visible (Hide)

keystone - ✨ 15th November 2021

Published by bladey almost 3 years ago

Expanded unique filters, customisable table and column names support and a new example featuring Nexus as we continue to finalise our GA release. 🪢

"@keystone-next/auth": "36.0.0",
"@keystone-next/cloudinary": "11.0.0",
"@keystone-next/fields-document": "13.0.0",
"@keystone-next/keystone": "28.0.0",
"@keystone-next/session-store-redis": "8.0.0",

Like this release? Give us a star on GitHub!

Expanded Unique Filters 🔎

select, timestamp, float and decimal fields with isIndexed: 'unique' now have unique filters via ListWhereUniqueInput which text, integer and the id field already support.

For example, if you added isIndexed: 'unique' to a select field in a theoretical Settings list, you can now run the following query:

query {
  setting ( where: { provider: "github" } ) {
    id
    token
  }
}

This is instead of running a settings query where you would have received a list back, and have had to check for results and get the first element:

query {
  settings ( where: { provider: { equals: "github" } } ) {
    id
    token
  }
}

Customisable Table and Column Names 📇

You may now use different table and column names to those automatically chosen by Keystone for your list and field keys. This is powered by Prisma's @map and @@map attributes. You can read more about this concept in Prisma's documentation.

This is useful if you do not want to modify your existing database (such as a read-only database) and use it with Keystone.

For example if you wanted to refer to a table named stories but you refer to it in Keystone as Posts provide config.db.map to a list or field key such as:

Post: list({
  db: {
    map: 'stories',
  },
  fields: {
    ...
  }
})

Nexus Example 🪢

We've got a new example using Nexus, a declarative, code-first and strongly typed GraphQL schema construction for TypeScript & JavaScript.

Using Nexus you can extend the GraphQL API provided by Keystone with custom queries and mutations.

In the example below we expose a mutation called nexusPosts which pulls out items from our Posts list that have been published within the past 7 days (by default), with an optional author filter.

export const PostQuery = extendType({
  type: "Query",
  definition(t) {
    t.field("nexusPosts", {
      type: nonNull(list("NexusPost")),
      args: {
        authorId: stringArg(),
        days: nonNull(intArg({ default: 7 })),
      },
      async resolve(root, { authorId, days }, context) {
        const cutoff = new Date(
          new Date().setUTCDate(new Date().getUTCDate() - days)
        ).toISOString();

        return await context.prisma.post.findMany({
          where: {
            ...(authorId ? { author: { id: authorId } } : null),
            publishDate: { gt: cutoff },
          },
        });
      },
    });
  },
});

Check out the example in Keystone's examples directory.

Miscellaneous Fixes ⚙️

  • The format of the date shown in the DatePicker now uses the user's locale.
  • When the sessionData option is invalid, the error will now be thrown on startup instead of silently ignored.

Changelog

You can also the verbose changelog in the related PR (https://github.com/keystonejs/keystone/pull/6914) for this release.

keystone - ⚙️ 10th November 2021

Published by bladey almost 3 years ago

Patch release.

"@keystone-next/keystone": "27.0.2",

Miscellaneous Fixes ⚙️

  • Fixed importing packages that provide Node ESM
  • Local images and files are no longer restricted behind ui.isAccessAllowed
  • Updated Prisma monorepo to v3.4.0

Enjoying Keystone?

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

Changelog

You can also view the verbose changelog in the related PR (https://github.com/keystonejs/keystone/pull/6892) for this release.

keystone - ⚙️ 3rd November 2021

Published by bladey almost 3 years ago

Patch release.

"@keystone-next/keystone": "27.0.1",

Miscellaneous Fixes ⚙️

  • Fixed files with names including things like [...rest] created using ui.getAdditionalFiles being deleted after being written in dev.
  • Runtime type errors from Prisma are now actually returned instead of being returned as Prisma error:
  • Fixed Schema must contain uniquely named types but contains multiple types named "OrderDirection". error when running keystone-next build.

Enjoying Keystone?

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

Changelog

You can also view the verbose changelog in the related PR (https://github.com/keystonejs/keystone/pull/6871) for this release.

keystone - ✨ 2nd November 2021

Published by bladey almost 3 years ago

Server-side Live Reloading is here! 🚀 Plus more updates as we finalise the Keystone 6 GA release.

"keystone-next/auth": "35.0.0",
"keystone-next/cloudinary": "10.0.0",
"keystone-next/fields-document": "12.0.0",
"keystone-next/keystone": "27.0.0",
"keystone-next/session-store-redis": "7.0.0",

Like this release? Give us a star on GitHub!

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

Server-side Live Reloading 🚀

Keystone now supports live reloading with keystone-next dev.

You can now update your GraphQL schema, change your hooks and access control, log errors and see how your data returns, then immediately use the playground to test it and iterate.

This is in addition to the current support for live reloading changes to custom views in the Admin UI.

How it works

When you run keystone-next dev now, it will start watching for changes to your config and schema. When changes are detected, Keystone will reload your config and schema and hot-swap the GraphQL endpoint.

To balance performance and predictability, Keystone does not do a complete restart when changes are made. The things to know are:

Prisma Schema Changes

The Prisma Client is not reloaded as you make changes to the Keystone Schema. If you make changes that affect your Prisma schema, Keystone will exit the process and wait for you to run keystone-next dev again.

This is because making database schema changes involves generating database migrations, and can result in data loss if those migrations are automatically run against your current database.

When adding or removing lists and fields (except virtual fields), we recommend you finish making your changes then start the dev process again. This will generate a single migration for all the changes you’ve made, and interactively prompt you to resolve any migrations that can't be run safely.

onConnect is not hot reloaded

The db.onConnect function (if specified) will only be run once when Keystone is started, and not when your config is hot reloaded.

This is because onConnect is typically used to run data seeding and other once-off processes that should be executed once before the Keystone server comes online. Re-running it whenever a file is changed could result in a heavy database load, harming overall dev performance and introducing unpredictable behaviour.

If you make changes to the onConnect function, you need to manually stop the dev process and start it again for your changes to take effect.

GraphQL Playground and Apollo Sandbox 🏝

In the last release we upgraded to Apollo Server 3 which brought Apollo Sandbox as the default development UI for testing your GraphQL queries.

This surfaced a number of issues as Apollo Sandbox is hosted remotely rather than locally, including CORS issues and security concerns, making it a bad default.

With this in mind, Keystone will now go back to using the GraphQL Playground by default instead of Apollo Sandbox as it did prior to updating to Apollo Server 3.

We have now introduced the graphql.playground config option, with three possible settings:

  • true will configure Apollo Server plugins to enable the GraphQL Playground
  • false will configure Apollo Server plugins to disable any GET requests to the GraphQL endpoint
  • 'apollo' will add no plugins to Apollo Server, enabling the new Apollo Sandbox behaviour

graphql.playground defaults to process.env.NODE_ENV !== 'production' which matches the previous Keystone 6 behaviour before the October update and Apollo Server 3.

Next.js Update ✨

We've updated our Next.js dependency from 11.x to 12.x! This latest release of Next.js includes a new Rust powered compiler with faster refresh and build rates, making your Keystone dev experience even faster.

Check out the Next.js blog for more details.

Relationship Filtering ❤️

If you have hundreds of items in your relationship fields, the Admin UI was sometimes displaying duplicate entries and/or missing entries.

We've made a series of improvements to fetching data resulting in a performance boost, as well as filtering fixes. We also changed the way we detect when an ID is pasted into the field allowing you to select a related item quickly.

CORS Configuration 🌐

We've removed the graphql.cors option, we had one too many ways to configure CORS and it was proving to be confusing.

You should now exclusively configure cors with the server.cors option.

Renamed src in Image and File Fields 🗄️

⚠️   Breaking Change

The src field on the output of image and file fields has been renamed to url.

Subsequently the getSrc function on ImagesContext and FilesContext has been renamed to getUrl.

Removed resolveFields 🚧

The deprecated resolveFields from context.query has been removed.

If you were still using it, you should switch to providing the query option to context.query or use context.db if you were providing false.

The context.query functions will now also throw an error if an empty string is passed to query rather than silently returning what the context.db functions return, you must select at least one field or omit the query option to default to selecting the id.

Internal Types Renamed ✏️

We have updated @graphql-ts/schema to 0.5.0.

The __rootVal properties on ObjectType, InterfaceType and UnionType have been renamed to __source, this is intended to be internal but you may have depended on it, if you were using it, rename __rootVal to __source.

In addition the fields property on InterfaceType has been renamed to __fields and it will no longer exist at runtime like the other types.

GraphQL Schema Reorder 🛗

We've made internal changes to the endSession field on the Mutation type and the keystone field on the Query type. This may result in re-ordering in your generated schema.graphql file.

Miscellaneous Fixes ⚙️

  • The sessionSchema export of @keystone-next/keystone/session has been removed.
  • context.session no longer has a value if the session is invalid.
  • text, integer, float and decimal on the item view now render correctly when using ui.itemView.fieldMode: 'read'.
  • Admin UI home page now respects ui.hideCreate and won't show a plus button when create is disabled.
  • Read-only arrays are now accepted where previously mutable arrays were required. Using as const when writing an array and then passing it to various APIs in Keystone will now work.
  • Fixed bug in LinkToRelatedItems button for double sided relationships.
  • Updated minor typos in GraphQL errors.

Prisma Update 🗃

We've updated our Prisma dependency from 3.1.1 to 3.3.0!

Check out the Prisma releases page for more details.

Credits 💫

  • Added a short plain-text display to document fields in the List view as well as a rendered document view in CardValue. Thanks @oplik0!

  • We now support extensions with numerical characters when generating safe filenames. Thanks @Zlitus!

Changelog

You can view the verbose change log in the related PR (https://github.com/keystonejs/keystone/pull/6762) for this release.

keystone - ✨ 5th October 2021

Published by bladey about 3 years ago

We're nearly at Gold Master status for the Keystone 6 GA release! Here's what's new:

  • Fields Overhaul with lots of tweaks and additions 🚀
  • Hook Updates bringing consolidation and clearer naming 🪝
  • Removal of unused return types and unused values 🚫
  • Renaming of options for consistency 📛
  • Apollo Server Upgrade to version 3 👩‍🚀
  • Improved Error Messaging 📟
  • Performance updates for a faster Admin UI 🏃‍♀️
  • REST API Example using the new createContext inside extendExpressApp 👩‍🏫
  • Other Notable Changes to be aware of 🛎️
  • Prisma Update from 2.x to 3.x 🗃

We've got further improvements to error messaging and performance to come in the next release!

Warning: This release contains breaking changes, please see below!

"@keystone-next/auth": "33.0.0",
"@keystone-next/cloudinary": "8.0.0",
"@keystone-next/fields-document": "10.0.0",
"@keystone-next/keystone": "26.0.1",
"@keystone-next/session-store-redis": "5.0.0",

Upgrade Guide 👇

Be sure to read the entire release notes below for everything you need to know about this new release.

The main things to keep in mind are:

  • defaultValue config is now static, if you have dynamic defaults, use the resolveInput hook
  • isRequired for fields is now validation: { isRequired } and we have new validation options such as min and max for some fields
  • We've made it clearer which fields are nullable in the database and tweaked the defaults, you now have more control but may need to migrate your database (more details below)
  • The hooks API has new arguments, and we've consolidated update and delete events into beforeOperation and afterOperation
  • context.lists has been renamed to context.query

Fields Overhaul 🚀

Keystone's field types have been given a big overhaul - including several breaking changes, read on to understand what has changed.

Warning: Some of these API changes are breaking and you will be required to update your project.

text

  • defaultValue is now a static value
  • isRequired has moved to validation.isRequired
  • Now requires that the value has a length of at least one
  • New validation.length.min, validation.length.max and validation.match options

float

  • defaultValue is now a static number
  • isRequired has moved to validation.isRequired
  • New validation.min and validation.max options

integer

  • defaultValue is now a static number or { kind: 'autoincrement' }
  • isRequired has moved to validation.isRequired
  • New validation.min and validation.max options

The autoIncrement field has also been removed, use the integer field with a defaultValue of { kind: 'autoincrement' }.

decimal

  • defaultValue is now a static number written as a string
  • isRequired has moved to validation.isRequired
  • Now requires the input isn't NaN
  • New validation.min and validation.max options

timestamp

  • defaultValue is now a static date time value in an ISO8601 string or { kind: 'now' }
  • isRequired has moved to validation.isRequired

The field can also be automatically set to the current time on a create/update by setting db.updatedAt: true, this will add Prisma's @updatedAt attribute to the field.

The timestamp field also now uses a custom GraphQL scalar type named DateTime which requires inputs as full ISO8601 date-time strings such as "2021-01-30T00:00:00.000Z". Using new Date().toISOString() will give you a string in the correct format.

select

  • dataType has been renamed to type
  • defaultValue is now a static value
  • isRequired has moved to validation.isRequired

The select can now also be cleared in the Admin UI when ui.displayMode is segmented-control.

password

  • defaultValue has been removed
  • isRequired has moved to validation.isRequired
  • rejectCommon has moved to validation.rejectCommon
  • minLength has moved to validation.length.min
  • New validation.length.max and validation.match options

validation.length.min also must be 1 or above, though it still defaults to 8.

If workFactor is outside of the range of 6 to 31, an error will now be thrown instead of the previous behaviour of clamping the value to 4 to 31 and warning if it's below 6.

image

  • Removed isRequired
  • Removed defaultValue

If you were using these options, the same behaviour can be re-created with the validateInput and resolveInput hooks respectively.

file

  • Removed isRequired
  • Removed defaultValue

If you were using these options, the same behaviour can be re-created with the validateInput and resolveInput hooks respectively.

cloudinaryImage

  • Removed isRequired
  • Removed defaultValue

If you were using these options, the same behaviour can be re-created with the validateInput and resolveInput hooks respectively.

json

  • Removed isRequired
  • defaultValue can no longer be dynamic in the json field

If you were using isRequired, the same behaviour can be re-created with the validateInput hook.

relationship

  • Removed defaultValue
  • Removed undocumented withMeta option

To re-create defaultValue, you can use resolveInput though note that if you're using autoincrement ids, you need to return the id as number, not a string like you would provide to GraphQL, e.g. { connect: { id: 1 } } rather than { connect: { id: "1" } }.

If you were using withMeta: false, please open an issue with your use case.

checkbox

The checkbox field is now non-nullable in the database, if you need three states, you should use the select field.

The field no longer accepts dynamic default values and it will default to false unless a different defaultValue is specified.

If you're using SQLite, Prisma will generate a migration that makes the column non-nullable and sets any rows that have null values to the defaultValue.

If you're using PostgreSQL, Prisma will generate a migration but you'll need to modify it if you have nulls in a checkbox field. Keystone will say that the migration cannot be executed:

✨ Starting Keystone
⭐️ Dev Server Ready on http://localhost:3000
✨ Generating GraphQL and Prisma schemas
✨ There has been a change to your Keystone schema that requires a migration

⚠️ We found changes that cannot be executed:

  • Made the column `isAdmin` on table `User` required, but there are 1 existing NULL values.

✔ Name of migration … make-is-admin-non-null
✨ A migration has been created at migrations/20210906053141_make_is_admin_non_null
Please edit the migration and run keystone-next dev again to apply the migration

The generated migration will look like this:

/*
  Warnings:

  - Made the column `isAdmin` on table `User` required. This step will fail if there are existing NULL values in that column.

*/
-- AlterTable
ALTER TABLE "User" ALTER COLUMN "isAdmin" SET NOT NULL,
ALTER COLUMN "isAdmin" SET DEFAULT false;

To make it set any null values to false in your database, you need to modify it so that it looks like this but with the table and column names replaced.

ALTER TABLE "User" ALTER COLUMN "isAdmin" SET DEFAULT false;
UPDATE "User" SET "isAdmin" = DEFAULT WHERE "isAdmin" IS NULL;
ALTER TABLE "User" ALTER COLUMN "isAdmin" SET NOT NULL;

document

The document field is now non-nullable in the database. The field no longer has defaultValue or isRequired options.

The same behaviour can be re-created with the validateInput and resolveInput hooks respectively.

The field will default to [{ "type": "paragraph", "children": [{ "text": "" }] }]. The output type has also been renamed to ListKey_fieldKey_Document

If you're using SQLite, Prisma will generate a migration that makes the column non-nullable and sets any rows that have null values to an empty paragraph.

If you're using PostgreSQL, Prisma will generate a migration but you'll need to modify it if you have nulls in a document field.

Keystone will say that the migration cannot be executed:

✨ Starting Keystone
⭐️ Dev Server Ready on http://localhost:3000
✨ Generating GraphQL and Prisma schemas
✨ There has been a change to your Keystone schema that requires a migration

⚠️ We found changes that cannot be executed:

  • Made the column `content` on table `Post` required, but there are 1 existing NULL values.

✔ Name of migration … make_document_field_non_null
✨ A migration has been created at migrations/20210915050920_make_document_field_non_null
Please edit the migration and run keystone-next dev again to apply the migration

The generated migration will look like this:

/*
  Warnings:

  - Made the column `content` on table `Post` required. This step will fail if there are existing NULL values in that column.

*/
-- AlterTable
ALTER TABLE "Post" ALTER COLUMN "content" SET NOT NULL,
ALTER COLUMN "content" SET DEFAULT E'[{"type":"paragraph","children":[{"text":""}]}]';

To make it set any null values to an empty paragraph in your database, you need to modify it so that it looks like this but with the table and column names replaced.

ALTER TABLE "Post" ALTER COLUMN "content" SET DEFAULT E'[{"type":"paragraph","children":[{"text":""}]}]';
UPDATE "Post" SET "content" = DEFAULT WHERE "content" IS NULL;
ALTER TABLE "Post" ALTER COLUMN "content" SET NOT NULL;

general

text, float, integer, decimal, timestamp, select, password can be made non-nullable at the database-level with the isNullable option which defaults to true, except for text which defaults to false.

All fields above except password can also have:

  • graphql.read.isNonNull set if the field has isNullable: false and you have no read access control and you don't intend to add any in the future, it will make the GraphQL output field non-nullable.

  • graphql.create.isNonNull set if you have no create access control and you don't intend to add any in the future, it will make the GraphQL create input field non-nullable.

Keep in mind, checkbox is now always non-nullable.

Hook Updates 🪝

We've consolidated the beforeChange/beforeDelete and afterChange/afterDelete hooks into beforeOperation and afterOperation.

Additionaly, we've renamed:

  • originalInput for access control functions to inputData

  • originalInput for hook functions to inputData

  • existingItem for all hooks (except afterOperation) to item

  • existingItem for afterOperation to originalItem

  • updatedItem for afterOperation to item

See the Hooks API docs for a complete reference for the updated API!

Removals 🚫

Some unused return types and unused values from enum definitions have been removed:

  • sendUserPasswordResetLink and sendUserMagicAuthLink only ever return null, so now have return types of Boolean.
  • UserAuthenticationWithPasswordFailure no longer has a code value.
  • MagicLinkRedemptionErrorCode and PasswordResetRedemptionErrorCode no longer have the values IDENTITY_NOT_FOUND, MULTIPLE_IDENTITY_MATCHES, TOKEN_NOT_SET, or TOKEN_MISMATCH.

If you were using the createSchema function, you can also remove the call to createSchema and pass the lists directly to the lists property.

Before:

import { config, createSchema, list } from '@keystone-next/keystone';

config({
  lists: createSchema({
   User: list({ ... }),
  }),
})

After:

import { config, list } from '@keystone-next/keystone';

config({
  lists: {
   User: list({ ... }),
  },
 })

We've removed the deprecated config.db.adapter option. Please use config.db.provider to indicate the database provider for your system.

Finally, the internal protectIdentities variable which was previously hardcoded to true to protect user data, there are no immediate plans to implement this as a configurable option.

Renames 📇

The API context.lists has been renamed to context.query, and context.db.lists has been renamed to context.db.

The skipAccessControl argument to createContext to sudo for consistency with context.sudo().

When using the experimental option config.experimental.generateNodeAPI, the api module now exports query rather than lists.

Renamed graphQLReturnFragment to ui.query in the virtual field options. The virtual field now checks if ui.query is required for the GraphQL output type, and throws an error if it is missing. If you don't want want the Admin UI to fetch the field, you can set ui.itemView.fieldMode and ui.listView.fieldMode to 'hidden' instead of providing ui.query.

Also, we've moved the graphql export of @keystone-next/keystone/types to @keystone-next/keystone.

Improved Error Messaging 📟

Error messages have been improved across the board, in summary:

  • On startup, we now output where the GraphQL API is located
  • If access is denied errors are thrown, we now state which operation isn't permitted
  • Bad relationship field inputs are detected and outputed
  • Clearer distinction if a user input is invalid
  • If access control functions return invalid values we state what we got and what we expected
  • Improved the error messages provided from the GraphQL API when extension code (e.g access control functions, hooks, etc) throws exceptions
  • Better formatting of GraphQL error messages resulting from Prisma errors
  • Clearer sign-in errors when logging into the Admin UI
  • Improved error messages when returning bad filters from filter access control

Performance 🚅

Field Mode

We've optimised the itemView field mode fetching - we now only fetch the item once to determine the field modes rather than once per field.

The Admin UI will also skip fetching fields that have a statically set itemView.fieldMode: 'hidden' on the itemView.

The id argument to the KeystoneAdminUIFieldMeta.itemView GraphQL field can now be omitted which will make KeystoneAdminUIFieldMetaItemView.fieldMode return null when there isn't a static field mode.

The itemView also no longer uses a sudo context when fetching the item in the KeystoneAdminUIFieldMetaItemView.fieldMode. Previously, if someone had access to the Admin UI(ui.isAccessAllowed) and a field had a itemView.fieldMode function that used the item argument, someone could bypass access control to determine whether or not an item with a given id exists.

Query Generation Performance

Query generation performance has been improved when querying single relationships without filter-based access control.

When resolving related items, we often have a foreign key available to us that we can use to help optimise the subsequent related item query. If, on top of this, there are no filter-based access control rules in place, then we can use the Prisma findUnique operation, which will group all the operations into a single database query. This solves the GraphQL N+1 query problem in this specific instance.

REST API Example 👩‍🏫

This release also adds createContext to the extendExpressApp function giving you access to the full context API from Keystone.

In a new example we demonstate how to create REST endpoints by extending Keystone's express app and using the Query API to execute queries against the schema.

Note: You can find all of our examples in our examples folder on GitHub.

Other Notable Changes 🛎️

  • The KeystoneAdminUIFieldMeta.isOrderable and KeystoneAdminUIFieldMeta.isFilterable fields are no longer statically resolvable and will now take into account the context/session. This also means isOrderable and isFilterable are no longer accessible on useList().fields[fieldKey].isOrderable/isFilterable, they can be fetched through GraphQL if you need them in the Admin UI.

  • The sendItemMagicAuthLink and sendItemPasswordResetLink mutations now always return true instead of always returning null

  • Added support for dynamic isFilterable and isOrderable field config values. If a function is provided for these config option, it will be dynamically evaluated each time the field is used for filtering and ordering, and an error will be returned if the function returns false.

Apollo Server Upgrade 👩‍🚀

Apollo Server has had a major upgrade to Version 3.

The Apollo documentation contains a full list of breaking changes introduced by this update.

You can configure the Apollo Server provided by Keystone using the graphql.apolloConfig configuration option.

The most prominent change for most users will be that the GraphQL Playground has been replaced by the Apollo Sandbox.

If you prefer to keep the GraphQL Playground, you can configure your server by following these instructions.

Prisma Update 🗃

We've updated our Prisma dependency from 2.30.2 to 3.1.1!

Note that Keystone continues to use the "binary" query engine, rather than the new "node-API" query engine, which is now the Prisma default. We are still performing tests to ensure that the node-API query engine will work well with Keystone.

Check out the Prisma releases page for more details on this major update.

Credits 💫

  • Exported Field types to help in updating contrib packages. Thanks @gautamsi!

  • Fixed remaining windows issue where it creates invalid import path. This removes some duplicate code which caused this. Thanks @gautamsi!

  • Added support for Prisma preview features via the config.db.prismaPreviewFeatures configuration option. Thanks @Nikitoring!

Changelog

You can view the verbose change log in the related PR (https://github.com/keystonejs/keystone/pull/6483) for this release.

keystone - ✨ 6th September 2021

Published by bladey about 3 years ago

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.

Releases

@keystone-next/[email protected]

Major Changes

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

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

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

@keystone-next/[email protected]

Major Changes

@keystone-next/[email protected]

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

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

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

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-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

@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

@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 - ✨ 17th August 2021

Published by bladey about 3 years ago

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.

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!

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.

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.

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

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

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

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

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/[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

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Major 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]

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

@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 - ✨ 29th July 2021

Published by bladey about 3 years ago

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 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 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.


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

  • #6153 7716315ea Thanks @mitchellhamilton! - Removed implicit chunking from the lists API so that the lists API is a direct translation of the GraphQL API

  • #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.

Minor Changes

  • #6111 9e2deac5f Thanks @gwyneplaine! - Added the ability to customise the Navigation component in the Admin UI, and provided helper components to do so.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #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.

Minor Changes

  • #6111 9e2deac5f Thanks @gwyneplaine! - Add Admin UI specific types AuthenticatedItem, VisibleLists, CreateViewFieldModes and NavigationProps to exports.

Patch Changes

  • #6192 93f1e5d30 Thanks @JedWatson! - Added an optional /_healthcheck endpoint to Keystone's express server.

    You can 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(),
          }),
        },
      },
    });
    
  • Updated dependencies [a11e54d69, e5f61ad50, e4e6cf9b5, 2ef6fe82c]:

@keystone-next/[email protected]

Minor Changes

  • #6193 14cb7c5c4 Thanks @timleslie! - Added an app value to the TestArgs type to provide direct access to the Express application from test runners.

Patch Changes

@keystone-ui/[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]

Major Changes

keystone - ✨ 13th July 2021

Published by bladey over 3 years ago

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:

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:

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.


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

@keystone-ui/[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]

Major 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]

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

@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

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

keystone - ✨ 30th June 2021

Published by bladey over 3 years ago

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.


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

keystone - ✨ 29th June 2021

Published by bladey over 3 years ago

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.


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

@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

keystone - ✨ 28th June 2021

Published by bladey over 3 years ago

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.


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

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

  • #5910 50ad1ce6b Thanks @mitchellhamilton! - Fixed generated list types to allow passing a value directly when a GraphQL list of the value is expected

  • #5907 0df3734d5 Thanks @mitchellhamilton! - Fixed 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>;
    
  • #5992 543154bc0 Thanks @timleslie! - Pinned dependency decimal.js to 10.2.1 to be consistent with Prisma.

  • Updated dependencies [de0a5c19e, 7a25925c3, 543154bc0, 972e04514]:

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Minor Changes

Patch Changes

@keystone-ui/[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 - ✨ 15th June 2021

Published by bladey over 3 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.


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

@keystone-next/[email protected]

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/[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

@keystone-next/[email protected]

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

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

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

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

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

Patch Changes

@keystone-ui/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Major Changes

Minor Changes

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

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

[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 - ✨ 2nd June 2021

Published by bladey over 3 years ago

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.


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

@keystone-next/[email protected]

Major Changes

  • #5797 a6a444acd Thanks @timleslie! - 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
    

Minor Changes

Patch Changes

@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,
        }),
      })
    );
    
  • #5772 f52079f0b Thanks @timleslie! - 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, 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 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.

  • #5777 74bc77854 Thanks @timleslie! - Updated the type of the skip argument to allItems from Int to Int! = 0.

  • #5792 319c19bd5 Thanks @timleslie! - Changed the type of the where argument to allItems to _allItemsMeta from type ItemWhereInput to ItemWhereInput! = {}.

  • #5832 195d4fb12 Thanks @timleslie! - Updated the functions getCommittedArtifacts, validateCommittedArtifacts, generateCommittedArtifacts, and generateNodeModulesArtifacts exported from artifacts.ts to accept a KeystoneConfig argument rather than a BaseKeystone object.

  • #5850 5b02e8625 Thanks @timleslie! - The AND and OR operators of ItemWhereInput now accept non-null values, e.g. [ItemWhereInput!], rather than [ItemWhereInput].

  • #5767 02af04c03 Thanks @timleslie! - Deprecated the sortBy GraphQL filter. 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 now order by multiple fields, e.g. allUsers(orderBy: [{ score: asc }, { name: asc }]). Each UserOrderByInput must have exactly one key, or else an error will be returned.

  • #5791 9de71a9fb Thanks @timleslie! - Changed the return type of allItems(...) from [User] to [User!], as this API can never have null items in the return array.

  • #5802 7bda87ea7 Thanks @timleslie! - Changed config.session to access a SessionStrategy 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 the keystone argument from the ExtendGraphqlSchema type. This will only impact you if you were directly constructing this function. Users of the graphQLSchemaExtension function will not be impacted.

  • #5787 bb4f4ac91 Thanks @timleslie! - Replaced req, session, createContext args to config.ui.pageMiddleware with a context arg.

Minor Changes

  • #5774 107eeb037 Thanks @jonowu! - Added sameSite 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

@keystone-next/[email protected]

Major Changes

  • #5815 b9c828fb0 Thanks @timleslie! - Fixed the type of originalInput in the argument to defaultValue.

  • #5802 7bda87ea7 Thanks @timleslie! - Changed config.session to access a SessionStrategy 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 the keystone argument from the ExtendGraphqlSchema type. This will only impact you if you were directly constructing this function. Users of the graphQLSchemaExtension function will not be impacted.

Patch Changes

  • #5831 5cc35170f Thanks @timleslie! - Updated the type of KeystoneContext.gqlNames to be GqlNames rather than just Record<string,string>.

  • #5767 02af04c03 Thanks @timleslie! - Deprecated the sortBy GraphQL filter. 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 now order by multiple fields, e.g. allUsers(orderBy: [{ score: asc }, { name: asc }]). Each UserOrderByInput 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! - Replaced req, session, createContext args to config.ui.pageMiddleware with a context arg.

  • Updated dependencies [b9c828fb0, a6a444acd, 59421c039, 0617c81ea, 02af04c03, 590bb1fe9, 19a756496]:

@keystone-next/[email protected]

Major Changes

  • #5767 02af04c03 Thanks @timleslie! - Deprecated the sortBy GraphQL filter. 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 now order by multiple fields, e.g. allUsers(orderBy: [{ score: asc }, { name: asc }]). Each UserOrderByInput must have exactly one key, or else an error will be returned.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5832 195d4fb12 Thanks @timleslie! - Updated the functions getCommittedArtifacts, validateCommittedArtifacts, generateCommittedArtifacts, and generateNodeModulesArtifacts exported from artifacts.ts to accept a KeystoneConfig argument rather than a BaseKeystone object.

Patch Changes

@keystone-ui/[email protected]

Minor Changes

Patch Changes

@keystone-ui/[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]

Major Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Minor Changes

Patch 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,
        }),
      })
    );
    
  • #5771 51aca916b Thanks @raveling! - New tutorial for Keystone Lite. First draft.

  • #5767 02af04c03 Thanks @timleslie! - Deprecated the sortBy GraphQL filter. 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 now order by multiple fields, e.g. allUsers(orderBy: [{ score: asc }, { name: asc }]). Each UserOrderByInput 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 of allItems(...) from [User] to [User!], as this API can never have null 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/[email protected]

Patch 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,
        }),
      })
    );
    
  • #5792 319c19bd5 Thanks @timleslie! - Changed the type of the where argument to allItems to _allItemsMeta from type ItemWhereInput to ItemWhereInput! = {}.

  • #5850 5b02e8625 Thanks @timleslie! - The AND and OR operators of ItemWhereInput now accept non-null values, e.g. [ItemWhereInput!], rather than [ItemWhereInput].

  • #5767 02af04c03 Thanks @timleslie! - Deprecated the sortBy GraphQL filter. 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 now order by multiple fields, e.g. allUsers(orderBy: [{ score: asc }, { name: asc }]). Each UserOrderByInput must have exactly one key, or else an error will be returned.

  • #5791 9de71a9fb Thanks @timleslie! - Changed the return type of allItems(...) from [User] to [User!], as this API can never have null 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/[email protected]

Patch 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,
        }),
      })
    );
    
  • #5797 a6a444acd Thanks @timleslie! - 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
    
  • #5792 319c19bd5 Thanks @timleslie! - Changed the type of the where argument to allItems to _allItemsMeta from type ItemWhereInput to ItemWhereInput! = {}.

  • #5850 5b02e8625 Thanks @timleslie! - The AND and OR operators of ItemWhereInput now accept non-null values, e.g. [ItemWhereInput!], rather than [ItemWhereInput].

  • #5767 02af04c03 Thanks @timleslie! - Deprecated the sortBy GraphQL filter. 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 now order by multiple fields, e.g. allUsers(orderBy: [{ score: asc }, { name: asc }]). Each UserOrderByInput must have exactly one key, or else an error will be returned.

  • #5791 9de71a9fb Thanks @timleslie! - Changed the return type of allItems(...) from [User] to [User!], as this API can never have null 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/[email protected]

Patch 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,
        }),
      })
    );
    
  • #5797 a6a444acd Thanks @timleslie! - 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
    
  • #5792 319c19bd5 Thanks @timleslie! - Changed the type of the where argument to allItems to _allItemsMeta from type ItemWhereInput to ItemWhereInput! = {}.

  • #5850 5b02e8625 Thanks @timleslie! - The AND and OR operators of ItemWhereInput now accept non-null values, e.g. [ItemWhereInput!], rather than [ItemWhereInput].

  • #5829 f36a70a55 Thanks @timleslie! - Updated insertSeedData to directly access context.prisma.

  • #5767 02af04c03 Thanks @timleslie! - Deprecated the sortBy GraphQL filter. 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 now order by multiple fields, e.g. allUsers(orderBy: [{ score: asc }, { name: asc }]). Each UserOrderByInput must have exactly one key, or else an error will be returned.

  • #5791 9de71a9fb Thanks @timleslie! - Changed the return type of allItems(...) from [User] to [User!], as this API can never have null 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/[email protected]

Patch Changes

[email protected]

Patch 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,
        }),
      })
    );
    
  • #5797 a6a444acd Thanks @timleslie! - 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
    
  • #5792 319c19bd5 Thanks @timleslie! - Changed the type of the where argument to allItems to _allItemsMeta from type ItemWhereInput to ItemWhereInput! = {}.

  • #5850 5b02e8625 Thanks @timleslie! - The AND and OR operators of ItemWhereInput now accept non-null values, e.g. [ItemWhereInput!], rather than [ItemWhereInput].

  • #5767 02af04c03 Thanks @timleslie! - Deprecated the sortBy GraphQL filter. 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 now order by multiple fields, e.g. allUsers(orderBy: [{ score: asc }, { name: asc }]). Each UserOrderByInput must have exactly one key, or else an error will be returned.

  • #5791 9de71a9fb Thanks @timleslie! - Changed the return type of allItems(...) from [User] to [User!], as this API can never have null 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/[email protected]

Patch 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,
        }),
      })
    );
    
  • #5797 a6a444acd Thanks @timleslie! - 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
    
  • #5792 319c19bd5 Thanks @timleslie! - Changed the type of the where argument to allItems to _allItemsMeta from type ItemWhereInput to ItemWhereInput! = {}.

  • #5850 5b02e8625 Thanks @timleslie! - The AND and OR operators of ItemWhereInput now accept non-null values, e.g. [ItemWhereInput!], rather than [ItemWhereInput].

  • #5767 02af04c03 Thanks @timleslie! - Deprecated the sortBy GraphQL filter. 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 now order by multiple fields, e.g. allUsers(orderBy: [{ score: asc }, { name: asc }]). Each UserOrderByInput must have exactly one key, or else an error will be returned.

  • #5791 9de71a9fb Thanks @timleslie! - Changed the return type of allItems(...) from [User] to [User!], as this API can never have null 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/[email protected]

Patch Changes

  • #5797 a6a444acd Thanks @timleslie! - 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
    
  • #5792 319c19bd5 Thanks @timleslie! - Changed the type of the where argument to allItems to _allItemsMeta from type ItemWhereInput to ItemWhereInput! = {}.

  • #5850 5b02e8625 Thanks @timleslie! - The AND and OR operators of ItemWhereInput now accept non-null values, e.g. [ItemWhereInput!], rather than [ItemWhereInput].

  • #5767 02af04c03 Thanks @timleslie! - Deprecated the sortBy GraphQL filter. 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 now order by multiple fields, e.g. allUsers(orderBy: [{ score: asc }, { name: asc }]). Each UserOrderByInput must have exactly one key, or else an error will be returned.

  • #5791 9de71a9fb Thanks @timleslie! - Changed the return type of allItems(...) from [User] to [User!], as this API can never have null 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/[email protected]

Patch Changes

  • #5797 a6a444acd Thanks @timleslie! - 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
    
  • #5792 319c19bd5 Thanks @timleslie! - Changed the type of the where argument to allItems to _allItemsMeta from type ItemWhereInput to ItemWhereInput! = {}.

  • #5850 5b02e8625 Thanks @timleslie! - The AND and OR operators of ItemWhereInput now accept non-null values, e.g. [ItemWhereInput!], rather than [ItemWhereInput].

  • #5767 02af04c03 Thanks @timleslie! - Deprecated the sortBy GraphQL filter. 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 now order by multiple fields, e.g. allUsers(orderBy: [{ score: asc }, { name: asc }]). Each UserOrderByInput must have exactly one key, or else an error will be returned.

  • #5791 9de71a9fb Thanks @timleslie! - Changed the return type of allItems(...) from [User] to [User!], as this API can never have null 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/[email protected]

Patch Changes

keystone - ✨ 19th May 2021

Published by bladey over 3 years ago

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.


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

@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

@keystone-next/[email protected]

Major 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

@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

@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.

Minor Changes

  • #5758 8da79e71a Thanks @timleslie! - Added a SKIP_PROMPTS environment variable to explicitly disable prompts in the CLI.

Patch Changes

@keystone-next/[email protected]

Major 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

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-ui/[email protected]

Major Changes

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

@keystone-next/[email protected]

Major Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

Patch Changes

[email protected]

Major Changes

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

@keystone-next/[email protected]

Major Changes

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

@keystonejs/[email protected]

Major Changes

keystone - ✨ 17th May 2021

Published by bladey over 3 years ago

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.


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

@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 - ✨ 11th May 2021

Published by bladey over 3 years ago

What's New

A bunch of admin UI tweaks in this release 🖥️, among other minor fixes. We also have the initial stages of a new blog example and a sweet new admin UI logo.

Enjoying Keystone?

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


Releases

@keystone-next/[email protected]

Minor Changes

Patch Changes

@keystone-ui/[email protected]

Patch Changes

  • #5642 dbe831976 Thanks @malitov! - Added hover state to the OptionPrimitive in Admin UI and updated css colors

@keystone-ui/[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]

Major Changes

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

keystone - ✨ Release - 5th May 2021

Published by bladey over 3 years ago

What's New

Aside from dependency updates 😴, we added an isIndexed config option to the text, integer, float, select, and timestamp field types.

If you look closely you’ll see the core team working on example projects to share Keystone some best-practices. Keep an eye out for those in the not too distant future 🔮.

Enjoying Keystone?

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


Releases

@keystone-next/[email protected]

Minor Changes

  • #5616 3d3894679 Thanks @timleslie! - Added an isIndexed config option to the text, integer, float, select, and timestamp field types.

Patch Changes

@keystone-next/[email protected]

Minor Changes

Patch Changes

@keystone-next/[email protected]

Minor Changes

  • #5616 3d3894679 Thanks @timleslie! - Added an isIndexed config option to the text, integer, float, select, and timestamp field types.

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5591 44c1f9494 Thanks @timleslie! - Simplified the Todo application to just the basics to allow other examples to build on it.

Patch Changes

@keystone-ui/[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

@keystone-next/[email protected]

Patch Changes

@keystone-next/[email protected]

Patch Changes

keystone - ✨ 3rd May 2021

Published by bladey over 3 years ago

What's New

This release involved a bunch of busywork behind the scenes in Keystone Next 🔧. Stripping away all the things we don't need now that we're using Prisma exclusively. The end of the cleanup is in sight, and we're getting closer to the point where we can start working on some great new features.

Files in Keystone Next 📁. Now you can use Admin UI to upload local files to your repo using SQLite. We also added a maxFileSize property for easier project config.

Enjoying Keystone?

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


Releases

@keystone-next/[email protected]

Major Changes

  • #5578 f7d4c9b9f Thanks @mitchellhamilton! - Replaced mode field on ImageFieldOutput GraphQL type with making ImageFieldOutput an interface and having a LocalImageFieldOutput type that implements ImageFieldOutput.

  • #5582 49dd46843 Thanks @gwyneplaine! - Changed image ref to now be ${mode}:image:${id}.

Minor Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

Minor Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

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]

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]

Minor Changes

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

@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 - ✨ Release - 20th April 2021

Published by bladey over 3 years ago

What's New

Improvements to the Lists API

To make the Lists API (i.e context.lists.{List}) more intuitive to use, we deprecated the resolveFields option in favour of two new methods 🔧:

1. Specify a string of fields to return with the new query option:

Use this when you want to query for resolved field values (including querying relationships and virtual fields). This replaces the resolveFields: false use case. Now you can query a Post like so:

const [post] = await context.lists.Post.findMany({
  where: { slug },
  query: `
    title
    content
    image {
      src
      width
      height
    }`,
});

2. Return the unresolved item data with read hooks

This replaces the resolveFields: boolean use case. We now have a new set of APIs on context.db.lists.{List} which return unresolved item data from your database (but with read hooks applied). They can be referenced directly or returned from a custom mutation or query in the GraphQL API to be handled by the Field resolvers.

For example, to query for the raw data stored in the database:

const [post] = await context.db.lists.Post.findMany({
  where: { slug },
});

Enjoying Keystone?

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


Releases

@keystone-ui/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-ui/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-ui/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

@keystone-ui/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

@keystone-ui/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-ui/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-ui/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-ui/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-ui/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

@keystone-ui/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

@keystone-ui/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-ui/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Minor Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

  • #5420 ecf07393a Thanks @timleslie! - Updated core fields implementation to expect an internal option type.adapter rather than type.adapters.prisma.

Patch Changes

@keystone-next/[email protected]

Major Changes

Minor Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5420 ecf07393a Thanks @timleslie! - Updated core fields implementation to expect an internal option type.adapter rather than type.adapters.prisma.

Patch Changes

@keystone-next/[email protected]

Major Changes

Minor Changes

  • #5451 9e060fe83 Thanks @JedWatson! - With the goal of making the Lists API (i.e context.lists.{List}) more intuitive to use, the resolveFields option has been deprecated in favor of two new methods:

    (1) You can specify a string of fields to return with the new query option, when you want to query for resolved field values (including querying relationships and virtual fields). This replaces the resolveFields: false use case.

    For example, to query a Post you would now write:

    const [post] = await context.lists.Post.findMany({
      where: { slug },
      query: `
        title
        content
        image {
          src
          width
          height
        }`,
    });
    

    (2) Alternatively, there is a new set of APIs on context.db.lists.{List} which will return the unresolved item data from the database (but with read hooks applied), which can then be referenced directly or returned from a custom mutation or query in the GraphQL API to be handled by the Field resolvers. This replaces the resolveFields: boolean use case.

    For example, to query for the raw data stored in the database, you would write:

    const [post] = await context.db.lists.Post.findMany({
      where: { slug },
    });
    
  • #5325 3d3fb860f Thanks @mitchellhamilton! - Updated to Prisma 2.20

  • #5378 6861ecb40 Thanks @renovate! - Updated Prisma to 2.21

  • #5396 be60812f2 Thanks @rohan-deshpande! - Added create-image-context, logic for parsing, storing and retrieving image data in keystone core.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

@keystone-next/[email protected]

Major Changes

  • #5467 7498fcabb Thanks @timleslie! - Removed the deprecated context.executeGraphQL. Identical functionality is available via context.graphql.raw.

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Minor Changes

  • #5451 9e060fe83 Thanks @JedWatson! - With the goal of making the Lists API (i.e context.lists.{List}) more intuitive to use, the resolveFields option has been deprecated in favor of two new methods:

    (1) You can specify a string of fields to return with the new query option, when you want to query for resolved field values (including querying relationships and virtual fields). This replaces the resolveFields: false use case.

    For example, to query a Post you would now write:

    const [post] = await context.lists.Post.findMany({
      where: { slug },
      query: `
        title
        content
        image {
          src
          width
          height
        }`,
    });
    

    (2) Alternatively, there is a new set of APIs on context.db.lists.{List} which will return the unresolved item data from the database (but with read hooks applied), which can then be referenced directly or returned from a custom mutation or query in the GraphQL API to be handled by the Field resolvers. This replaces the resolveFields: boolean use case.

    For example, to query for the raw data stored in the database, you would write:

    const [post] = await context.db.lists.Post.findMany({
      where: { slug },
    });
    
  • #5396 be60812f2 Thanks @rohan-deshpande! - Added types for new images functionality in keystone.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Minor Changes

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

  • #5387 406acca51 Thanks @timleslie! - Replaced type AdapterName with ProviderName. Updated all functions which accepted an AdapterName value named adapterName to accept a ProviderName argument named provider.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Minor Changes

  • #5403 d0adec53f Thanks @gwyneplaine! - Added a humanize fn which is string transformation logic ported over from @keystone-next/keystone.

Patch Changes

@keystone-next/[email protected]

Patch Changes

@keystone-ui/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

  • #5451 9e060fe83 Thanks @JedWatson! - With the goal of making the Lists API (i.e context.lists.{List}) more intuitive to use, the resolveFields option has been deprecated in favor of two new methods:

    (1) You can specify a string of fields to return with the new query option, when you want to query for resolved field values (including querying relationships and virtual fields). This replaces the resolveFields: false use case.

    For example, to query a Post you would now write:

    const [post] = await context.lists.Post.findMany({
      where: { slug },
      query: `
        title
        content
        image {
          src
          width
          height
        }`,
    });
    

    (2) Alternatively, there is a new set of APIs on context.db.lists.{List} which will return the unresolved item data from the database (but with read hooks applied), which can then be referenced directly or returned from a custom mutation or query in the GraphQL API to be handled by the Field resolvers. This replaces the resolveFields: boolean use case.

    For example, to query for the raw data stored in the database, you would write:

    const [post] = await context.db.lists.Post.findMany({
      where: { slug },
    });
    
  • #5467 7498fcabb Thanks @timleslie! - Removed the deprecated context.executeGraphQL. Identical functionality is available via context.graphql.raw.

  • #5471 838247cc0 Thanks @raveling! - Fixed typo in guide meta title.

  • #5366 115b06130 Thanks @renovate! - Updated Next.js dependency to ^10.1.3.

  • Updated dependencies [fe55e9289, a5627304b, 1d85d7ff4, 43a0f5429, d7e8cad4f, ecf07393a, 8eebf9195]:

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

  • #5451 9e060fe83 Thanks @JedWatson! - With the goal of making the Lists API (i.e context.lists.{List}) more intuitive to use, the resolveFields option has been deprecated in favor of two new methods:

    (1) You can specify a string of fields to return with the new query option, when you want to query for resolved field values (including querying relationships and virtual fields). This replaces the resolveFields: false use case.

    For example, to query a Post you would now write:

    const [post] = await context.lists.Post.findMany({
      where: { slug },
      query: `
        title
        content
        image {
          src
          width
          height
        }`,
    });
    

    (2) Alternatively, there is a new set of APIs on context.db.lists.{List} which will return the unresolved item data from the database (but with read hooks applied), which can then be referenced directly or returned from a custom mutation or query in the GraphQL API to be handled by the Field resolvers. This replaces the resolveFields: boolean use case.

    For example, to query for the raw data stored in the database, you would write:

    const [post] = await context.db.lists.Post.findMany({
      where: { slug },
    });
    
  • #5400 d7e8cad4f Thanks @timleslie! - Moved the Implementation base class from the fields-legacy package into the fields package.

  • Updated dependencies [9e060fe83, b0db0a7a8, 7498fcabb, 11f5bb631, d0adec53f, 5f2673704, a5627304b, ea708559f, 406acca51, 1d85d7ff4, 0e74d8123, 5106e4bbe, be60812f2]:

@keystone-next/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

@keystonejs/[email protected]

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

[email protected]

Patch Changes