From 6b5afb5c3861a48beac619da34b599f89a81dbd3 Mon Sep 17 00:00:00 2001 From: Darrell Warde Date: Wed, 30 Aug 2023 18:22:45 +0100 Subject: [PATCH] Adds some missing migration steps, and fixes a typo --- .../migration/v4-migration/authorization.adoc | 2 +- .../pages/migration/v4-migration/index.adoc | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/modules/ROOT/pages/migration/v4-migration/authorization.adoc b/modules/ROOT/pages/migration/v4-migration/authorization.adoc index 1666054d..fdedf470 100644 --- a/modules/ROOT/pages/migration/v4-migration/authorization.adoc +++ b/modules/ROOT/pages/migration/v4-migration/authorization.adoc @@ -101,7 +101,7 @@ const server = new ApolloServer({ const { url } = await startStandaloneServer(server, { listen: { port: 4000 }, context: async ({ req }) => ({ - token: req.headers.Authorization, + token: req.headers.authorization, }), }); ---- diff --git a/modules/ROOT/pages/migration/v4-migration/index.adoc b/modules/ROOT/pages/migration/v4-migration/index.adoc index 4baa3148..7d60313a 100644 --- a/modules/ROOT/pages/migration/v4-migration/index.adoc +++ b/modules/ROOT/pages/migration/v4-migration/index.adoc @@ -572,6 +572,20 @@ type query { Additionally, escaping strings is no longer needed. +=== `@exclude` removed + +The `@exclude` directive has been removed in favor of much more granular configuration directives. + +The new `@query`, `@mutation` and `@subscription` directives instead allow for fully granular configuration for each operation. + +As a direct migration, the following usages are equivalent: + +* `@exclude` and `@query(read: false, aggregate: false) @mutation(operations: []) @subscription(events: [])`. +* `@exclude(operations: [READ])` and `@query(read: false, aggregate: false)`. +* `@exclude(operation: [CREATE, UPDATE, DELETE])` and `@mutation(operations: [])`. + +Whilst there is more verbosity, the directives are significantly more powerful and extensible as the library gains features. + [full-text-migration] === `@fulltext` changes @@ -854,6 +868,16 @@ type Record @limit(default: 10, max: 100) { } ---- +=== `@readonly` and `@writeonly` removed + +The `@readonly` and `@writeonly` directives have been removed in favor of more granular configuration directives. +The new `@selectable` and `@settable` directives can be used to configure not only if fields are readable or writable, but also when they should be readable or writable. + +As a direct migration, the following usages are equivalent: + +* `@readonly` and `@settable(onCreate: false, onUpdate: false)`. +* `@writeonly` and `@selectable(onRead: false, onAggregate: false)`. + [relationship-aggregate] === `@relationship` changes