nuxt-graphql-middleware 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/plugin.mjs +4 -5
  2. package/package.json +1 -1
package/dist/plugin.mjs CHANGED
@@ -73,7 +73,7 @@ class GraphqlMiddlewarePlugin {
73
73
  const params = new URLSearchParams({
74
74
  name
75
75
  });
76
- let fetchOptions = {
76
+ let defaultOptions = {
77
77
  method: "POST",
78
78
  credentials: "include",
79
79
  headers: {
@@ -84,10 +84,9 @@ class GraphqlMiddlewarePlugin {
84
84
  },
85
85
  body: JSON.stringify(variables)
86
86
  };
87
- if (this.beforeRequestFn) {
88
- fetchOptions = this.beforeRequestFn(this.context, fetchOptions);
89
- }
90
- return fetch(this.baseURL + "/mutate?" + params.toString(), fetchOptions).then((response) => response.json());
87
+ return this.doBeforeRequest(defaultOptions).then((fetchOptions) => {
88
+ return fetch(this.baseURL + "/mutate?" + params.toString(), fetchOptions).then((response) => response.json());
89
+ });
91
90
  }
92
91
  }
93
92
  const graphqlMiddlewarePlugin = (context, inject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-graphql-middleware",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Module to perform GraphQL requests as a server middleware.",
5
5
  "repository": {
6
6
  "type": "git",