@graphql-codegen/typescript-react-query 3.2.2-alpha-1f4053433.0 → 3.2.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.
- package/config.d.ts +1 -1
- package/index.js +2 -1
- package/index.mjs +2 -1
- package/package.json +2 -2
package/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RawClientSideBasePluginConfig } from '@graphql-codegen/visitor-plugin-common';
|
|
2
2
|
export declare type HardcodedFetch = {
|
|
3
3
|
endpoint: string;
|
|
4
|
-
fetchParams?: string
|
|
4
|
+
fetchParams?: string | Record<string, any>;
|
|
5
5
|
};
|
|
6
6
|
export declare type CustomFetch = {
|
|
7
7
|
func: string;
|
package/index.js
CHANGED
|
@@ -331,7 +331,8 @@ class HardcodedFetchFetcher {
|
|
|
331
331
|
getFetchParams() {
|
|
332
332
|
let fetchParamsPartial = '';
|
|
333
333
|
if (this.config.fetchParams) {
|
|
334
|
-
|
|
334
|
+
const fetchParamsString = typeof this.config.fetchParams === 'string' ? this.config.fetchParams : JSON.stringify(this.config.fetchParams);
|
|
335
|
+
fetchParamsPartial = `\n ...(${fetchParamsString}),`;
|
|
335
336
|
}
|
|
336
337
|
return ` method: "POST",${fetchParamsPartial}`;
|
|
337
338
|
}
|
package/index.mjs
CHANGED
|
@@ -325,7 +325,8 @@ class HardcodedFetchFetcher {
|
|
|
325
325
|
getFetchParams() {
|
|
326
326
|
let fetchParamsPartial = '';
|
|
327
327
|
if (this.config.fetchParams) {
|
|
328
|
-
|
|
328
|
+
const fetchParamsString = typeof this.config.fetchParams === 'string' ? this.config.fetchParams : JSON.stringify(this.config.fetchParams);
|
|
329
|
+
fetchParamsPartial = `\n ...(${fetchParamsString}),`;
|
|
329
330
|
}
|
|
330
331
|
return ` method: "POST",${fetchParamsPartial}`;
|
|
331
332
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-react-query",
|
|
3
|
-
"version": "3.2.2
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating a ready-to-use React-Query Hooks based on GraphQL operations",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@graphql-codegen/plugin-helpers": "^2.3.0",
|
|
11
|
-
"@graphql-codegen/visitor-plugin-common": "2.
|
|
11
|
+
"@graphql-codegen/visitor-plugin-common": "2.5.1",
|
|
12
12
|
"auto-bind": "~4.0.0",
|
|
13
13
|
"change-case-all": "1.0.14",
|
|
14
14
|
"tslib": "~2.3.0"
|