@graphql-codegen/typescript-graphql-request 4.3.1-alpha-2113b7d34.0 → 4.3.2-alpha-1f4053433.0
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 +9 -9
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +2 -2
package/config.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { RawClientSideBasePluginConfig } from '@graphql-codegen/visitor-plugin-common';
|
|
2
2
|
/**
|
|
3
|
-
* @description This plugin generates [`graphql-request`](https://
|
|
3
|
+
* @description This plugin generates [`graphql-request`](https://npmjs.com/package/graphql-request) ready-to-use SDK, which is fully-typed.
|
|
4
4
|
*/
|
|
5
5
|
export interface RawGraphQLRequestPluginConfig extends RawClientSideBasePluginConfig {
|
|
6
6
|
/**
|
|
7
|
-
* @description By default the `request` method return the `data` or `errors` key from the response. If you need to access the `extensions` key you can use the `rawRequest` method.
|
|
7
|
+
* @description By default, the `request` method return the `data` or `errors` key from the response. If you need to access the `extensions` key you can use the `rawRequest` method.
|
|
8
8
|
* @default false
|
|
9
9
|
*
|
|
10
10
|
* @exampleMarkdown
|
|
11
11
|
* ```yml
|
|
12
12
|
* generates:
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
13
|
+
* path/to/file.ts:
|
|
14
|
+
* plugins:
|
|
15
|
+
* - typescript
|
|
16
|
+
* - typescript-operations
|
|
17
|
+
* - typescript-graphql-request
|
|
18
|
+
* config:
|
|
19
|
+
* rawRequest: true
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
rawRequest?: boolean;
|
package/index.js
CHANGED
|
@@ -17,7 +17,7 @@ class GraphQLRequestVisitor extends visitorPluginCommon.ClientSideBaseVisitor {
|
|
|
17
17
|
constructor(schema, fragments, rawConfig) {
|
|
18
18
|
super(schema, fragments, rawConfig, {
|
|
19
19
|
rawRequest: visitorPluginCommon.getConfigValue(rawConfig.rawRequest, false),
|
|
20
|
-
extensionsType: visitorPluginCommon.getConfigValue(rawConfig.extensionsType,
|
|
20
|
+
extensionsType: visitorPluginCommon.getConfigValue(rawConfig.extensionsType, 'any'),
|
|
21
21
|
});
|
|
22
22
|
this._operationsToInclude = [];
|
|
23
23
|
autoBind(this);
|
|
@@ -27,7 +27,7 @@ class GraphQLRequestVisitor extends visitorPluginCommon.ClientSideBaseVisitor {
|
|
|
27
27
|
if (this.config.rawRequest) {
|
|
28
28
|
this._additionalImports.push(`${typeImport} { GraphQLError } from 'graphql-request/dist/types';`);
|
|
29
29
|
if (this.config.documentMode !== visitorPluginCommon.DocumentMode.string) {
|
|
30
|
-
this._additionalImports.push(
|
|
30
|
+
this._additionalImports.push(`import { print } from 'graphql'`);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
package/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ class GraphQLRequestVisitor extends ClientSideBaseVisitor {
|
|
|
11
11
|
constructor(schema, fragments, rawConfig) {
|
|
12
12
|
super(schema, fragments, rawConfig, {
|
|
13
13
|
rawRequest: getConfigValue(rawConfig.rawRequest, false),
|
|
14
|
-
extensionsType: getConfigValue(rawConfig.extensionsType,
|
|
14
|
+
extensionsType: getConfigValue(rawConfig.extensionsType, 'any'),
|
|
15
15
|
});
|
|
16
16
|
this._operationsToInclude = [];
|
|
17
17
|
autoBind(this);
|
|
@@ -21,7 +21,7 @@ class GraphQLRequestVisitor extends ClientSideBaseVisitor {
|
|
|
21
21
|
if (this.config.rawRequest) {
|
|
22
22
|
this._additionalImports.push(`${typeImport} { GraphQLError } from 'graphql-request/dist/types';`);
|
|
23
23
|
if (this.config.documentMode !== DocumentMode.string) {
|
|
24
|
-
this._additionalImports.push(
|
|
24
|
+
this._additionalImports.push(`import { print } from 'graphql'`);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-graphql-request",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.2-alpha-1f4053433.0",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating a ready-to-use SDK based on graphql-request and 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",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@graphql-codegen/plugin-helpers": "^2.3.0",
|
|
12
|
-
"@graphql-codegen/visitor-plugin-common": "2.
|
|
12
|
+
"@graphql-codegen/visitor-plugin-common": "2.6.0-alpha-1f4053433.0",
|
|
13
13
|
"auto-bind": "~4.0.0",
|
|
14
14
|
"tslib": "~2.3.0"
|
|
15
15
|
},
|