Skip to content

Commit

Permalink
docs(changeset): GrafastExecutionArgs now accepts resolvedPreset
Browse files Browse the repository at this point in the history
…and `requestContext`

directly; passing these through additional arguments is now deprecated.

`plugin.grafast.hooks.args` is now `plugin.grafast.middleware.prepareArgs`, and
the signature has changed - you must be sure to call the `next()` function and
ctx/resolvedPreset can be extracted directly from `args`:

```diff
 const plugin = {
   grafast: {
-    hooks: {
+    middleware: {
-      args({ args, ctx, resolvedPreset }) {
+      prepareArgs(next, { args }) {
+        const { requestContext: ctx, resolvedPreset } = args;
         // ...
+        return next();
       }
     }
   }
 }
```
  • Loading branch information
benjie committed May 21, 2024
1 parent 6439091 commit 582bd76
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .changeset/smooth-bats-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
"graphile-build": patch
"postgraphile": patch
"graphile-config": patch
"@dataplan/pg": patch
"grafserv": patch
"grafast": patch
---

`GrafastExecutionArgs` now accepts `resolvedPreset` and `requestContext`
directly; passing these through additional arguments is now deprecated.

`plugin.grafast.hooks.args` is now `plugin.grafast.middleware.prepareArgs`, and
the signature has changed - you must be sure to call the `next()` function and
ctx/resolvedPreset can be extracted directly from `args`:

```diff
const plugin = {
grafast: {
- hooks: {
+ middleware: {
- args({ args, ctx, resolvedPreset }) {
+ prepareArgs(next, { args }) {
+ const { requestContext: ctx, resolvedPreset } = args;
// ...
+ return next();
}
}
}
}
```

0 comments on commit 582bd76

Please sign in to comment.