@graphql-codegen/typescript-react-query 4.0.5 → 4.0.6-alpha-20221123103250-201a4c78f
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.
|
@@ -8,8 +8,12 @@ class GraphQLRequestClientFetcher {
|
|
|
8
8
|
}
|
|
9
9
|
generateFetcherImplementaion() {
|
|
10
10
|
return `
|
|
11
|
-
function fetcher<TData, TVariables>(client: GraphQLClient, query: string, variables?: TVariables,
|
|
12
|
-
return async (): Promise<TData> => client.request
|
|
11
|
+
function fetcher<TData, TVariables extends { [key: string]: any }>(client: GraphQLClient, query: string, variables?: TVariables, requestHeaders?: RequestInit['headers']) {
|
|
12
|
+
return async (): Promise<TData> => client.request({
|
|
13
|
+
document: query,
|
|
14
|
+
variables,
|
|
15
|
+
requestHeaders
|
|
16
|
+
});
|
|
13
17
|
}`;
|
|
14
18
|
}
|
|
15
19
|
generateInfiniteQueryHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
@@ -5,8 +5,12 @@ export class GraphQLRequestClientFetcher {
|
|
|
5
5
|
}
|
|
6
6
|
generateFetcherImplementaion() {
|
|
7
7
|
return `
|
|
8
|
-
function fetcher<TData, TVariables>(client: GraphQLClient, query: string, variables?: TVariables,
|
|
9
|
-
return async (): Promise<TData> => client.request
|
|
8
|
+
function fetcher<TData, TVariables extends { [key: string]: any }>(client: GraphQLClient, query: string, variables?: TVariables, requestHeaders?: RequestInit['headers']) {
|
|
9
|
+
return async (): Promise<TData> => client.request({
|
|
10
|
+
document: query,
|
|
11
|
+
variables,
|
|
12
|
+
requestHeaders
|
|
13
|
+
});
|
|
10
14
|
}`;
|
|
11
15
|
}
|
|
12
16
|
generateInfiniteQueryHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-react-query",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.6-alpha-20221123103250-201a4c78f",
|
|
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"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/dotansimha/graphql-code-generator.git",
|
|
17
|
+
"url": "https://github.com/dotansimha/graphql-code-generator-community.git",
|
|
18
18
|
"directory": "packages/plugins/typescript/react-query"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|