Skip to content

Commit

Permalink
Remove context.executeGraphQL (#5467)
Browse files Browse the repository at this point in the history
* Remove context.executeGraphQL

* Update .changeset/cyan-rules-smoke.md

Co-authored-by: Mitchell Hamilton <mitchell@hamil.town>
  • Loading branch information
timleslie and emmatown committed Apr 15, 2021
1 parent ac78b2a commit 7498fca
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .changeset/cyan-rules-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@keystone-next/keystone': major
'@keystone-next/types': major
'@keystone-next/website': patch
---

Removed the deprecated `context.executeGraphQL`. Identical functionality is available via `context.graphql.raw`.
3 changes: 0 additions & 3 deletions docs-next/pages/apis/context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ context = {

// Deprecated
gqlNames,
executeGraphQL,
keystone,
};
```
Expand Down Expand Up @@ -130,8 +129,6 @@ 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.

`executeGraphQL`: This function is identical to `context.graphql.raw`, which is the preferred API to use.

`keystone`: An object representing the internal state of the system.

export default ({ children }) => <Markdown>{children}</Markdown>;
5 changes: 2 additions & 3 deletions packages-next/keystone/src/lib/createContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ export function makeCreateContext({
}),
req,
...sessionContext,
// Note: These two fields let us use the server-side-graphql-client library.
// We may want to remove them once the updated itemAPI w/ query is available.
executeGraphQL: rawGraphQL,
// Note: This field lets us use the server-side-graphql-client library.
// We may want to remove it once the updated itemAPI w/ query is available.
gqlNames: (listKey: string) => keystone.lists[listKey].gqlNames,
};
const getArgsByList = schemaName === 'public' ? publicGetArgsByList : internalGetArgsByList;
Expand Down
2 changes: 0 additions & 2 deletions packages-next/types/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export type KeystoneContext = {
/** @deprecated */
gqlNames: (listKey: string) => Record<string, string>; // TODO: actual keys
/** @deprecated */
executeGraphQL: any; // TODO: type this
/** @deprecated */
keystone: BaseKeystone;
} & AccessControlContext &
Partial<SessionContext<any>> &
Expand Down

1 comment on commit 7498fca

@vercel
Copy link

@vercel vercel bot commented on 7498fca Apr 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.