diff --git a/.changeset/add-number-id.md b/.changeset/add-number-id.md index bcb9552ec13..83346d86c5b 100644 --- a/.changeset/add-number-id.md +++ b/.changeset/add-number-id.md @@ -1,5 +1,5 @@ ----- +--- '@keystone-6/core': patch ----- +--- -Use `idField` type of `{ kind: 'number', kind: 'Int' | 'BigInt' }` internally for singletons +Use `db.idField` of `{ kind: 'number', kind: 'Int' }` internally for singletons diff --git a/.changeset/better-relationship-errors.md b/.changeset/better-relationship-errors.md index 89a4767e2b2..85ed3f2010d 100644 --- a/.changeset/better-relationship-errors.md +++ b/.changeset/better-relationship-errors.md @@ -1,5 +1,5 @@ ----- +--- '@keystone-6/core': patch ----- +--- Fix static relationship resolution errors to conform to nominal error structure diff --git a/.changeset/boolean-not-false-2.md b/.changeset/boolean-not-false-2.md index 3c47acbecd5..84e380028f4 100644 --- a/.changeset/boolean-not-false-2.md +++ b/.changeset/boolean-not-false-2.md @@ -1,5 +1,5 @@ ----- +--- '@keystone-6/core': patch ----- +--- -Fix `config.server.cors` type blocking `false` values +Fix `config.server.cors` type preventing value of `false` diff --git a/.changeset/boolean-not-false.md b/.changeset/boolean-not-false.md index 3a7a0a78d20..97d359a18cc 100644 --- a/.changeset/boolean-not-false.md +++ b/.changeset/boolean-not-false.md @@ -1,5 +1,5 @@ ----- +--- '@keystone-6/core': patch ----- +--- -Fix `defaultIsFilterable` and `defaultIsOrderable` types blocking `true` values +Fix `defaultIsFilterable` and `defaultIsOrderable` types preventing value of `true` diff --git a/.changeset/contributors.json b/.changeset/contributors.json index 566b2ff1a96..45f6a9b4d8b 100644 --- a/.changeset/contributors.json +++ b/.changeset/contributors.json @@ -7,6 +7,7 @@ "DiesIrae", "DustinWoods", "Greenheart", + "Grumaks", "JedWatson", "MadeByMike", "MarcelMalik", @@ -14,6 +15,7 @@ "MohammadKurjieh", "MurzNN", "Noviny", + "PaulAroo", "ScottAgirs", "SeanDoyleGit", "Skulek", @@ -32,6 +34,7 @@ "bladey", "borisno2", "ciruz", + "dagrinchi", "dcousens", "dependabot", "dependabot[bot]", diff --git a/.changeset/deprecate-validate-hooks-f.md b/.changeset/deprecate-validate-hooks-f.md index 7fe432ada1a..79a655cd759 100644 --- a/.changeset/deprecate-validate-hooks-f.md +++ b/.changeset/deprecate-validate-hooks-f.md @@ -1,5 +1,5 @@ ----- +--- '@keystone-6/core': minor ----- +--- Adds `{field}.hooks.validate.[create|update|delete]` hooks, deprecates `validateInput` and `validateDelete` (throws if incompatible) diff --git a/.changeset/deprecate-validate-hooks.md b/.changeset/deprecate-validate-hooks.md index 6eab436497c..b3f9eb4c856 100644 --- a/.changeset/deprecate-validate-hooks.md +++ b/.changeset/deprecate-validate-hooks.md @@ -1,5 +1,5 @@ ----- +--- '@keystone-6/core': minor ----- +--- Adds `{list}.hooks.validate.[create|update|delete]` hooks, deprecates `validateInput` and `validateDelete` diff --git a/.changeset/error-if-wrong-type.md b/.changeset/error-if-wrong-type.md index 324f62d9a2b..9b2531d8988 100644 --- a/.changeset/error-if-wrong-type.md +++ b/.changeset/error-if-wrong-type.md @@ -1,5 +1,5 @@ ----- +--- '@keystone-6/auth': patch ----- +--- Fix `createInitial*` and `send*MagicAuthLink` to throw if the expected type from `sessionStrategy.start` is not a string diff --git a/.changeset/fix-create-express-app.md b/.changeset/fix-create-express-app.md index 25d9adfbbdf..deb215b6dc7 100644 --- a/.changeset/fix-create-express-app.md +++ b/.changeset/fix-create-express-app.md @@ -1,5 +1,5 @@ ----- +--- '@keystone-6/core': patch ----- +--- -Fixes `createExpressApp` to use `context.graphql.schema` rather than the GraphQLSchema argument, removing ambiguity in downstream usage +Fixes `createExpressApp` to use `context.graphql.schema`, not the GraphQLSchema argument diff --git a/.changeset/http-async.md b/.changeset/http-async.md index b4ab6555df9..1160979d9e3 100644 --- a/.changeset/http-async.md +++ b/.changeset/http-async.md @@ -2,4 +2,4 @@ '@keystone-6/core': minor --- -Add `async` to `extendHttpServer`, for `await` on startup +Add `async` to `extendHttpServer`, to support `await` on startup diff --git a/.changeset/less-extend-http-server.md b/.changeset/less-extend-http-server.md index 0c798fbf64c..4a7f2001c60 100644 --- a/.changeset/less-extend-http-server.md +++ b/.changeset/less-extend-http-server.md @@ -1,5 +1,5 @@ ----- +--- '@keystone-6/core': patch ----- +--- -Deprecates `extendHttpServer`'s `graphqlSchema` argument; use `context.graphql.schema` now +Deprecates `extendHttpServer`'s `graphqlSchema` argument, use `context.graphql.schema` instead diff --git a/.changeset/less-extend-type.md b/.changeset/less-extend-type.md index 484a3af5f50..3e07049f562 100644 --- a/.changeset/less-extend-type.md +++ b/.changeset/less-extend-type.md @@ -1,5 +1,5 @@ --- -'@keystone-6/core': Patch +'@keystone-6/core': patch --- Deprecates `ExtendGraphQLSchema` type, use type `(schema: GraphQLSchema) => GraphQLSchema` instead diff --git a/.changeset/less-plimit.md b/.changeset/less-plimit.md index d96c0c0cd2e..5b5732117d1 100644 --- a/.changeset/less-plimit.md +++ b/.changeset/less-plimit.md @@ -1,5 +1,5 @@ ----- +--- '@keystone-6/core': patch ----- +--- Fix global locking by dropping global `p-limit` on `context.query`/`context.db` diff --git a/.changeset/same-field-order.md b/.changeset/same-field-order.md index 84eba66d14b..0fa991a13ae 100644 --- a/.changeset/same-field-order.md +++ b/.changeset/same-field-order.md @@ -1,5 +1,5 @@ ----- +--- '@keystone-6/core': patch ----- +--- Fix `image` field type to use consistent sub-field ordering diff --git a/.changeset/text-null-default.md b/.changeset/text-null-default.md index c77c6bceca1..3405e022f17 100644 --- a/.changeset/text-null-default.md +++ b/.changeset/text-null-default.md @@ -1,5 +1,5 @@ ----- +--- '@keystone-6/core': patch ----- +--- Fixes the `text` field type to accept a `defaultValue` of `null` diff --git a/docs/pages/docs/context/overview.md b/docs/pages/docs/context/overview.md index a8684768231..42cf9a29752 100644 --- a/docs/pages/docs/context/overview.md +++ b/docs/pages/docs/context/overview.md @@ -11,19 +11,23 @@ The APIs provided by the `Context` object can be used to write the business logi The `Context` object has the following properties, which are documented below. ```typescript -import type { Context } from '.keystone/types'; - -context = { - // HTTP request object - req, - res, +import type { Context } from '.keystone/types' +const context = { // Query API query, - // Internal DB object API + // Database API db, + // HTTP request object + req, + res, + + // Session API + session, + sessionStrategy + // GraphQL helpers graphql: { schema, @@ -31,17 +35,12 @@ context = { raw, }, - // Session API - session, - sessionStrategy - // New context creators sudo, - exitSudo, - withSession, withRequest, + withSession, - // Database access + // Raw Prisma access prisma, // Images API @@ -50,10 +49,7 @@ context = { getDataFromRef, getDataFromStream, }, - - // Deprecated - gqlNames, -}; +} ``` ### HTTP request object @@ -137,13 +133,6 @@ type ImageData = { `async images.getDataFromStream(stream)`: Given a readable data stream, returns an `ImageData` object. The `mode` will be taken from `config.images.mode`, and `id` will be a `uuid` value. The other values will be inferred from the data stream itself. The contents of the stream will be written to the filesystem at `config.images.local.storagePath`. -### Deprecated - -The following properties are deprecated and should not be used. -They will be removed in future releases. - -`gqlNames`: A function which takes a `listKey` and returns an object containing the GraphQL query, mutation and type names related to that list. - ## Related resources {% related-content %}