-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove actions argument to hooks (#3171)
- Loading branch information
Showing
10 changed files
with
62 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
'@keystonejs/fields': major | ||
'@keystonejs/keystone': major | ||
'@keystonejs/api-tests': patch | ||
'@keystonejs/demo-custom-fields': patch | ||
--- | ||
|
||
Hooks no longer recieve a `{ query }` argument. This functionality has been superseded by `context.executeGraphQL()`. | ||
|
||
``` | ||
{ | ||
... | ||
hooks: { | ||
resolveInput: async ({ actions: { query } } ) => { | ||
... | ||
const { data, errors } = await query(`{ ... }`); | ||
... | ||
} | ||
} | ||
} | ||
``` | ||
|
||
should be changed to | ||
|
||
``` | ||
{ | ||
... | ||
hooks: { | ||
resolveInput: async ({ context } ) => { | ||
... | ||
const { data, errors } = await context.executeGraphQL({ query: `{ ... }` }); | ||
... | ||
} | ||
} | ||
} | ||
``` | ||
|
||
See [the docs](/docs/discussions/server-side-graphql.md) for more details on how to use `context.executeGraphQL()`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.