@graphql-codegen/typescript-graphql-request 4.5.8-alpha-20221101110911-a036e7a25 → 4.5.9
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/index.js +2 -2
- package/cjs/visitor.js +4 -2
- package/esm/index.js +2 -2
- package/esm/visitor.js +4 -2
- package/package.json +5 -5
- package/typings/index.d.cts +2 -2
- package/typings/index.d.ts +2 -2
- package/typings/visitor.d.cts +1 -1
- package/typings/visitor.d.ts +1 -1
package/cjs/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GraphQLRequestVisitor = exports.validate = exports.plugin = void 0;
|
|
4
|
-
const
|
|
4
|
+
const path_1 = require("path");
|
|
5
5
|
const graphql_1 = require("graphql");
|
|
6
|
+
const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
|
|
6
7
|
const visitor_js_1 = require("./visitor.js");
|
|
7
8
|
Object.defineProperty(exports, "GraphQLRequestVisitor", { enumerable: true, get: function () { return visitor_js_1.GraphQLRequestVisitor; } });
|
|
8
|
-
const path_1 = require("path");
|
|
9
9
|
const plugin = (schema, documents, config) => {
|
|
10
10
|
const allAst = (0, graphql_1.concatAST)(documents.map(v => v.document));
|
|
11
11
|
const allFragments = [
|
package/cjs/visitor.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GraphQLRequestVisitor = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common");
|
|
6
5
|
const auto_bind_1 = tslib_1.__importDefault(require("auto-bind"));
|
|
7
6
|
const graphql_1 = require("graphql");
|
|
7
|
+
const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common");
|
|
8
8
|
const additionalExportedTypes = `
|
|
9
9
|
export type SdkFunctionWrapper = <T>(action: (requestHeaders?:Record<string, string>) => Promise<T>, operationName: string, operationType?: string) => Promise<T>;
|
|
10
10
|
`;
|
|
@@ -23,7 +23,9 @@ class GraphQLRequestVisitor extends visitor_plugin_common_1.ClientSideBaseVisito
|
|
|
23
23
|
if (this.config.rawRequest && this.config.documentMode !== visitor_plugin_common_1.DocumentMode.string) {
|
|
24
24
|
this._additionalImports.push(`import { print } from 'graphql'`);
|
|
25
25
|
}
|
|
26
|
-
this._externalImportPrefix = this.config.importOperationTypesFrom
|
|
26
|
+
this._externalImportPrefix = this.config.importOperationTypesFrom
|
|
27
|
+
? `${this.config.importOperationTypesFrom}.`
|
|
28
|
+
: '';
|
|
27
29
|
}
|
|
28
30
|
OperationDefinition(node) {
|
|
29
31
|
var _a;
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { extname } from 'path';
|
|
2
2
|
import { concatAST, Kind } from 'graphql';
|
|
3
|
+
import { oldVisit } from '@graphql-codegen/plugin-helpers';
|
|
3
4
|
import { GraphQLRequestVisitor } from './visitor.js';
|
|
4
|
-
import { extname } from 'path';
|
|
5
5
|
export const plugin = (schema, documents, config) => {
|
|
6
6
|
const allAst = concatAST(documents.map(v => v.document));
|
|
7
7
|
const allFragments = [
|
package/esm/visitor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ClientSideBaseVisitor, DocumentMode, getConfigValue, indentMultiline, } from '@graphql-codegen/visitor-plugin-common';
|
|
2
1
|
import autoBind from 'auto-bind';
|
|
3
2
|
import { Kind, print } from 'graphql';
|
|
3
|
+
import { ClientSideBaseVisitor, DocumentMode, getConfigValue, indentMultiline, } from '@graphql-codegen/visitor-plugin-common';
|
|
4
4
|
const additionalExportedTypes = `
|
|
5
5
|
export type SdkFunctionWrapper = <T>(action: (requestHeaders?:Record<string, string>) => Promise<T>, operationName: string, operationType?: string) => Promise<T>;
|
|
6
6
|
`;
|
|
@@ -19,7 +19,9 @@ export class GraphQLRequestVisitor extends ClientSideBaseVisitor {
|
|
|
19
19
|
if (this.config.rawRequest && this.config.documentMode !== DocumentMode.string) {
|
|
20
20
|
this._additionalImports.push(`import { print } from 'graphql'`);
|
|
21
21
|
}
|
|
22
|
-
this._externalImportPrefix = this.config.importOperationTypesFrom
|
|
22
|
+
this._externalImportPrefix = this.config.importOperationTypesFrom
|
|
23
|
+
? `${this.config.importOperationTypesFrom}.`
|
|
24
|
+
: '';
|
|
23
25
|
}
|
|
24
26
|
OperationDefinition(node) {
|
|
25
27
|
var _a;
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-graphql-request",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.9",
|
|
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",
|
|
7
|
-
"graphql-request": "^3.4.0 || ^4.0.0 ||
|
|
7
|
+
"graphql-request": "^3.4.0 || ^4.0.0 || ~5.0.0 || ~5.1.0",
|
|
8
8
|
"graphql-tag": "^2.0.0"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@graphql-codegen/plugin-helpers": "
|
|
12
|
-
"@graphql-codegen/visitor-plugin-common": "2.13.1
|
|
11
|
+
"@graphql-codegen/plugin-helpers": "^3.0.0",
|
|
12
|
+
"@graphql-codegen/visitor-plugin-common": "2.13.1",
|
|
13
13
|
"auto-bind": "~4.0.0",
|
|
14
14
|
"tslib": "~2.4.0"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "https://github.com/dotansimha/graphql-code-generator.git",
|
|
18
|
+
"url": "https://github.com/dotansimha/graphql-code-generator-community.git",
|
|
19
19
|
"directory": "packages/plugins/typescript/graphql-request"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
package/typings/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GraphQLRequestVisitor } from './visitor.cjs';
|
|
1
|
+
import { PluginFunction, PluginValidateFn } from '@graphql-codegen/plugin-helpers';
|
|
3
2
|
import { RawGraphQLRequestPluginConfig } from './config.cjs';
|
|
3
|
+
import { GraphQLRequestVisitor } from './visitor.cjs';
|
|
4
4
|
export declare const plugin: PluginFunction<RawGraphQLRequestPluginConfig>;
|
|
5
5
|
export declare const validate: PluginValidateFn<any>;
|
|
6
6
|
export { GraphQLRequestVisitor };
|
package/typings/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GraphQLRequestVisitor } from './visitor.js';
|
|
1
|
+
import { PluginFunction, PluginValidateFn } from '@graphql-codegen/plugin-helpers';
|
|
3
2
|
import { RawGraphQLRequestPluginConfig } from './config.js';
|
|
3
|
+
import { GraphQLRequestVisitor } from './visitor.js';
|
|
4
4
|
export declare const plugin: PluginFunction<RawGraphQLRequestPluginConfig>;
|
|
5
5
|
export declare const validate: PluginValidateFn<any>;
|
|
6
6
|
export { GraphQLRequestVisitor };
|
package/typings/visitor.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ClientSideBasePluginConfig, ClientSideBaseVisitor, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
|
|
2
1
|
import { GraphQLSchema, OperationDefinitionNode } from 'graphql';
|
|
2
|
+
import { ClientSideBasePluginConfig, ClientSideBaseVisitor, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
|
|
3
3
|
import { RawGraphQLRequestPluginConfig } from './config.cjs';
|
|
4
4
|
export interface GraphQLRequestPluginConfig extends ClientSideBasePluginConfig {
|
|
5
5
|
rawRequest: boolean;
|
package/typings/visitor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ClientSideBasePluginConfig, ClientSideBaseVisitor, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
|
|
2
1
|
import { GraphQLSchema, OperationDefinitionNode } from 'graphql';
|
|
2
|
+
import { ClientSideBasePluginConfig, ClientSideBaseVisitor, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
|
|
3
3
|
import { RawGraphQLRequestPluginConfig } from './config.js';
|
|
4
4
|
export interface GraphQLRequestPluginConfig extends ClientSideBasePluginConfig {
|
|
5
5
|
rawRequest: boolean;
|