@graphql-codegen/typescript-graphql-request 4.5.0-alpha-bd464a586.0 → 4.5.1-alpha-ffbef2e95.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/cjs/visitor.js +3 -0
- package/esm/visitor.js +3 -0
- package/package.json +3 -3
- package/typings/visitor.d.ts +1 -0
package/cjs/visitor.js
CHANGED
|
@@ -22,6 +22,7 @@ class GraphQLRequestVisitor extends visitor_plugin_common_1.ClientSideBaseVisito
|
|
|
22
22
|
if (this.config.rawRequest && this.config.documentMode !== visitor_plugin_common_1.DocumentMode.string) {
|
|
23
23
|
this._additionalImports.push(`import { print } from 'graphql'`);
|
|
24
24
|
}
|
|
25
|
+
this._externalImportPrefix = this.config.importOperationTypesFrom ? `${this.config.importOperationTypesFrom}.` : '';
|
|
25
26
|
}
|
|
26
27
|
OperationDefinition(node) {
|
|
27
28
|
var _a;
|
|
@@ -34,6 +35,8 @@ class GraphQLRequestVisitor extends visitor_plugin_common_1.ClientSideBaseVisito
|
|
|
34
35
|
return super.OperationDefinition(node);
|
|
35
36
|
}
|
|
36
37
|
buildOperation(node, documentVariableName, operationType, operationResultType, operationVariablesTypes) {
|
|
38
|
+
operationResultType = this._externalImportPrefix + operationResultType;
|
|
39
|
+
operationVariablesTypes = this._externalImportPrefix + operationVariablesTypes;
|
|
37
40
|
this._operationsToInclude.push({
|
|
38
41
|
node,
|
|
39
42
|
documentVariableName,
|
package/esm/visitor.js
CHANGED
|
@@ -18,6 +18,7 @@ export class GraphQLRequestVisitor extends ClientSideBaseVisitor {
|
|
|
18
18
|
if (this.config.rawRequest && this.config.documentMode !== DocumentMode.string) {
|
|
19
19
|
this._additionalImports.push(`import { print } from 'graphql'`);
|
|
20
20
|
}
|
|
21
|
+
this._externalImportPrefix = this.config.importOperationTypesFrom ? `${this.config.importOperationTypesFrom}.` : '';
|
|
21
22
|
}
|
|
22
23
|
OperationDefinition(node) {
|
|
23
24
|
var _a;
|
|
@@ -30,6 +31,8 @@ export class GraphQLRequestVisitor extends ClientSideBaseVisitor {
|
|
|
30
31
|
return super.OperationDefinition(node);
|
|
31
32
|
}
|
|
32
33
|
buildOperation(node, documentVariableName, operationType, operationResultType, operationVariablesTypes) {
|
|
34
|
+
operationResultType = this._externalImportPrefix + operationResultType;
|
|
35
|
+
operationVariablesTypes = this._externalImportPrefix + operationVariablesTypes;
|
|
33
36
|
this._operationsToInclude.push({
|
|
34
37
|
node,
|
|
35
38
|
documentVariableName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-graphql-request",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.1-alpha-ffbef2e95.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",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"graphql-tag": "^2.0.0"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@graphql-codegen/plugin-helpers": "^2.5.0
|
|
12
|
-
"@graphql-codegen/visitor-plugin-common": "2.11.
|
|
11
|
+
"@graphql-codegen/plugin-helpers": "^2.5.0",
|
|
12
|
+
"@graphql-codegen/visitor-plugin-common": "2.11.1-alpha-ffbef2e95.0",
|
|
13
13
|
"auto-bind": "~4.0.0",
|
|
14
14
|
"tslib": "~2.4.0"
|
|
15
15
|
},
|
package/typings/visitor.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface GraphQLRequestPluginConfig extends ClientSideBasePluginConfig {
|
|
|
6
6
|
extensionsType: string;
|
|
7
7
|
}
|
|
8
8
|
export declare class GraphQLRequestVisitor extends ClientSideBaseVisitor<RawGraphQLRequestPluginConfig, GraphQLRequestPluginConfig> {
|
|
9
|
+
private _externalImportPrefix;
|
|
9
10
|
private _operationsToInclude;
|
|
10
11
|
constructor(schema: GraphQLSchema, fragments: LoadedFragment[], rawConfig: RawGraphQLRequestPluginConfig);
|
|
11
12
|
OperationDefinition(node: OperationDefinitionNode): string;
|