@graphql-codegen/typescript-react-query 7.0.2 → 7.0.3
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.
|
@@ -32,7 +32,7 @@ class HardcodedFetchFetcher extends fetcher_js_1.FetcherRenderer {
|
|
|
32
32
|
}
|
|
33
33
|
generateFetcherImplementation() {
|
|
34
34
|
return `
|
|
35
|
-
function fetcher<TData, TVariables>(query:
|
|
35
|
+
function fetcher<TData, TVariables>(query: TypedDocumentString<unknown, unknown>, variables?: TVariables) {
|
|
36
36
|
return async (): Promise<TData> => {
|
|
37
37
|
const res = await fetch(${this.getEndpoint()}, {
|
|
38
38
|
${this.getFetchParams()}
|
package/cjs/fetcher-fetch.js
CHANGED
|
@@ -12,7 +12,7 @@ class FetchFetcher extends fetcher_js_1.FetcherRenderer {
|
|
|
12
12
|
}
|
|
13
13
|
generateFetcherImplementation() {
|
|
14
14
|
return `
|
|
15
|
-
function fetcher<TData, TVariables>(endpoint: string, requestInit: RequestInit, query:
|
|
15
|
+
function fetcher<TData, TVariables>(endpoint: string, requestInit: RequestInit, query: TypedDocumentString<unknown, unknown>, variables?: TVariables) {
|
|
16
16
|
return async (): Promise<TData> => {
|
|
17
17
|
const res = await fetch(endpoint, {
|
|
18
18
|
method: 'POST',
|
|
@@ -14,7 +14,7 @@ class GraphQLRequestClientFetcher extends fetcher_js_1.FetcherRenderer {
|
|
|
14
14
|
generateFetcherImplementation() {
|
|
15
15
|
return this.clientPath
|
|
16
16
|
? `
|
|
17
|
-
function fetcher<TData, TVariables extends { [key: string]: any }>(query:
|
|
17
|
+
function fetcher<TData, TVariables extends { [key: string]: any }>(query: TypedDocumentString<unknown, unknown>, variables?: TVariables, requestHeaders?: RequestInit['headers']) {
|
|
18
18
|
return async (): Promise<TData> => graphqlClient.request({
|
|
19
19
|
document: query,
|
|
20
20
|
variables,
|
|
@@ -22,7 +22,7 @@ function fetcher<TData, TVariables extends { [key: string]: any }>(query: string
|
|
|
22
22
|
});
|
|
23
23
|
}`
|
|
24
24
|
: `
|
|
25
|
-
function fetcher<TData, TVariables extends { [key: string]: any }>(client: GraphQLClient, query:
|
|
25
|
+
function fetcher<TData, TVariables extends { [key: string]: any }>(client: GraphQLClient, query: TypedDocumentString<unknown, unknown>, variables?: TVariables, requestHeaders?: RequestInit['headers']) {
|
|
26
26
|
return async (): Promise<TData> => client.request({
|
|
27
27
|
document: query,
|
|
28
28
|
variables,
|
|
@@ -28,7 +28,7 @@ export class HardcodedFetchFetcher extends FetcherRenderer {
|
|
|
28
28
|
}
|
|
29
29
|
generateFetcherImplementation() {
|
|
30
30
|
return `
|
|
31
|
-
function fetcher<TData, TVariables>(query:
|
|
31
|
+
function fetcher<TData, TVariables>(query: TypedDocumentString<unknown, unknown>, variables?: TVariables) {
|
|
32
32
|
return async (): Promise<TData> => {
|
|
33
33
|
const res = await fetch(${this.getEndpoint()}, {
|
|
34
34
|
${this.getFetchParams()}
|
package/esm/fetcher-fetch.js
CHANGED
|
@@ -8,7 +8,7 @@ export class FetchFetcher extends FetcherRenderer {
|
|
|
8
8
|
}
|
|
9
9
|
generateFetcherImplementation() {
|
|
10
10
|
return `
|
|
11
|
-
function fetcher<TData, TVariables>(endpoint: string, requestInit: RequestInit, query:
|
|
11
|
+
function fetcher<TData, TVariables>(endpoint: string, requestInit: RequestInit, query: TypedDocumentString<unknown, unknown>, variables?: TVariables) {
|
|
12
12
|
return async (): Promise<TData> => {
|
|
13
13
|
const res = await fetch(endpoint, {
|
|
14
14
|
method: 'POST',
|
|
@@ -10,7 +10,7 @@ export class GraphQLRequestClientFetcher extends FetcherRenderer {
|
|
|
10
10
|
generateFetcherImplementation() {
|
|
11
11
|
return this.clientPath
|
|
12
12
|
? `
|
|
13
|
-
function fetcher<TData, TVariables extends { [key: string]: any }>(query:
|
|
13
|
+
function fetcher<TData, TVariables extends { [key: string]: any }>(query: TypedDocumentString<unknown, unknown>, variables?: TVariables, requestHeaders?: RequestInit['headers']) {
|
|
14
14
|
return async (): Promise<TData> => graphqlClient.request({
|
|
15
15
|
document: query,
|
|
16
16
|
variables,
|
|
@@ -18,7 +18,7 @@ function fetcher<TData, TVariables extends { [key: string]: any }>(query: string
|
|
|
18
18
|
});
|
|
19
19
|
}`
|
|
20
20
|
: `
|
|
21
|
-
function fetcher<TData, TVariables extends { [key: string]: any }>(client: GraphQLClient, query:
|
|
21
|
+
function fetcher<TData, TVariables extends { [key: string]: any }>(client: GraphQLClient, query: TypedDocumentString<unknown, unknown>, variables?: TVariables, requestHeaders?: RequestInit['headers']) {
|
|
22
22
|
return async (): Promise<TData> => client.request({
|
|
23
23
|
document: query,
|
|
24
24
|
variables,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-react-query",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.3",
|
|
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"
|