Skip to content

Commit

Permalink
Update HTTP Executor and add method and useGETForQueries to Graph…
Browse files Browse the repository at this point in the history
…iQL options (#3133)

* Update HTTP Executor and add `method` and `useGETForQueries` to GraphiQL options

* chore(dependencies): updated changesets for modified dependencies

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
ardatan and github-actions[bot] authored Dec 7, 2023
1 parent 29b0b6e commit 77d107f
Show file tree
Hide file tree
Showing 5 changed files with 372 additions and 234 deletions.
7 changes: 7 additions & 0 deletions .changeset/@graphql-yoga_graphiql-3133-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@graphql-yoga/graphiql': patch
---
dependencies updates:
- Updated dependency [`@graphql-tools/[email protected]`
↗︎](https://www.npmjs.com/package/@graphql-tools/url-loader/v/8.0.1) (from `8.0.0`, in
`dependencies`)
6 changes: 6 additions & 0 deletions .changeset/mighty-actors-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'graphql-yoga': patch
'@graphql-yoga/graphiql': patch
---

Update HTTP Executor and add `method` and `useGETForQueries` to GraphiQL options
2 changes: 1 addition & 1 deletion packages/graphiql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"@graphiql/plugin-explorer": "^0.1.4",
"@graphiql/toolkit": "0.8.4",
"@graphql-tools/url-loader": "8.0.0",
"@graphql-tools/url-loader": "8.0.1",
"graphiql": "2.0.7",
"graphql": "16.6.0",
"json-bigint-patch": "0.0.8",
Expand Down
8 changes: 8 additions & 0 deletions packages/graphql-yoga/src/plugins/use-graphiql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ export type GraphiQLOptions = {
* Extra headers you always want to pass with users' headers input
*/
additionalHeaders?: Record<string, string>;
/**
* HTTP method to use when querying the original schema.
*/
method?: 'GET' | 'POST';
/**
* Whether to use the GET HTTP method for queries when querying the original schema
*/
useGETForQueries?: boolean;
};

export type GraphiQLRendererOptions = {
Expand Down
Loading

0 comments on commit 77d107f

Please sign in to comment.