@graphql-codegen/typescript-apollo-angular 3.5.6 → 4.0.0-alpha-20230524083052-08ce957b4
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/config.js +0 -2
- package/cjs/index.js +2 -2
- package/cjs/visitor.js +7 -4
- package/esm/config.js +0 -1
- package/esm/index.js +2 -2
- package/esm/visitor.js +7 -4
- package/package.json +7 -4
- package/typings/index.d.cts +2 -2
- package/typings/index.d.ts +2 -2
- package/typings/visitor.d.cts +3 -3
- package/typings/visitor.d.ts +3 -3
package/cjs/config.js
CHANGED
package/cjs/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ApolloAngularVisitor = exports.validate = exports.addToSchema = 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, "ApolloAngularVisitor", { enumerable: true, get: function () { return visitor_js_1.ApolloAngularVisitor; } });
|
|
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 operations = allAst.definitions.filter(d => d.kind === graphql_1.Kind.OPERATION_DEFINITION);
|
package/cjs/visitor.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ApolloAngularVisitor = 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
|
-
const graphql_1 = require("graphql");
|
|
8
6
|
const change_case_all_1 = require("change-case-all");
|
|
7
|
+
const graphql_1 = require("graphql");
|
|
8
|
+
const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common");
|
|
9
9
|
const R_MOD = /module:\s*"([^"]+)"/; // matches: module: "..."
|
|
10
10
|
const R_NAME = /name:\s*"([^"]+)"/; // matches: name: "..."
|
|
11
11
|
function R_DEF(directive) {
|
|
@@ -26,7 +26,9 @@ class ApolloAngularVisitor extends visitor_plugin_common_1.ClientSideBaseVisitor
|
|
|
26
26
|
additionalDI: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.additionalDI, []),
|
|
27
27
|
apolloAngularPackage: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.apolloAngularPackage, 'apollo-angular'),
|
|
28
28
|
apolloAngularVersion: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.apolloAngularVersion, 2),
|
|
29
|
-
gqlImport: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.gqlImport, !rawConfig.apolloAngularVersion || rawConfig.apolloAngularVersion === 2
|
|
29
|
+
gqlImport: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.gqlImport, !rawConfig.apolloAngularVersion || rawConfig.apolloAngularVersion === 2
|
|
30
|
+
? `apollo-angular#gql`
|
|
31
|
+
: null),
|
|
30
32
|
addExplicitOverride: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.addExplicitOverride, false),
|
|
31
33
|
}, documents);
|
|
32
34
|
this._allOperations = _allOperations;
|
|
@@ -36,7 +38,8 @@ class ApolloAngularVisitor extends visitor_plugin_common_1.ClientSideBaseVisitor
|
|
|
36
38
|
this.dependencyInjectionArgs = '';
|
|
37
39
|
if (this.config.importOperationTypesFrom) {
|
|
38
40
|
this._externalImportPrefix = `${this.config.importOperationTypesFrom}.`;
|
|
39
|
-
if (this.config.documentMode !== visitor_plugin_common_1.DocumentMode.external ||
|
|
41
|
+
if (this.config.documentMode !== visitor_plugin_common_1.DocumentMode.external ||
|
|
42
|
+
!this.config.importDocumentNodeExternallyFrom) {
|
|
40
43
|
// eslint-disable-next-line no-console
|
|
41
44
|
console.warn('"importOperationTypesFrom" should be used with "documentMode=external" and "importDocumentNodeExternallyFrom"');
|
|
42
45
|
}
|
package/esm/config.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { extname } from 'path';
|
|
2
|
+
import { concatAST, Kind, parse, } from 'graphql';
|
|
1
3
|
import { oldVisit } from '@graphql-codegen/plugin-helpers';
|
|
2
|
-
import { concatAST, Kind, parse } from 'graphql';
|
|
3
4
|
import { ApolloAngularVisitor } 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 operations = allAst.definitions.filter(d => d.kind === Kind.OPERATION_DEFINITION);
|
package/esm/visitor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ClientSideBaseVisitor, DocumentMode, indentMultiline, getConfigValue, indent, } from '@graphql-codegen/visitor-plugin-common';
|
|
2
1
|
import autoBind from 'auto-bind';
|
|
3
|
-
import { print, visit, Kind } from 'graphql';
|
|
4
2
|
import { camelCase } from 'change-case-all';
|
|
3
|
+
import { Kind, print, visit } from 'graphql';
|
|
4
|
+
import { ClientSideBaseVisitor, DocumentMode, getConfigValue, indent, indentMultiline, } from '@graphql-codegen/visitor-plugin-common';
|
|
5
5
|
const R_MOD = /module:\s*"([^"]+)"/; // matches: module: "..."
|
|
6
6
|
const R_NAME = /name:\s*"([^"]+)"/; // matches: name: "..."
|
|
7
7
|
function R_DEF(directive) {
|
|
@@ -22,7 +22,9 @@ export class ApolloAngularVisitor extends ClientSideBaseVisitor {
|
|
|
22
22
|
additionalDI: getConfigValue(rawConfig.additionalDI, []),
|
|
23
23
|
apolloAngularPackage: getConfigValue(rawConfig.apolloAngularPackage, 'apollo-angular'),
|
|
24
24
|
apolloAngularVersion: getConfigValue(rawConfig.apolloAngularVersion, 2),
|
|
25
|
-
gqlImport: getConfigValue(rawConfig.gqlImport, !rawConfig.apolloAngularVersion || rawConfig.apolloAngularVersion === 2
|
|
25
|
+
gqlImport: getConfigValue(rawConfig.gqlImport, !rawConfig.apolloAngularVersion || rawConfig.apolloAngularVersion === 2
|
|
26
|
+
? `apollo-angular#gql`
|
|
27
|
+
: null),
|
|
26
28
|
addExplicitOverride: getConfigValue(rawConfig.addExplicitOverride, false),
|
|
27
29
|
}, documents);
|
|
28
30
|
this._allOperations = _allOperations;
|
|
@@ -32,7 +34,8 @@ export class ApolloAngularVisitor extends ClientSideBaseVisitor {
|
|
|
32
34
|
this.dependencyInjectionArgs = '';
|
|
33
35
|
if (this.config.importOperationTypesFrom) {
|
|
34
36
|
this._externalImportPrefix = `${this.config.importOperationTypesFrom}.`;
|
|
35
|
-
if (this.config.documentMode !== DocumentMode.external ||
|
|
37
|
+
if (this.config.documentMode !== DocumentMode.external ||
|
|
38
|
+
!this.config.importDocumentNodeExternallyFrom) {
|
|
36
39
|
// eslint-disable-next-line no-console
|
|
37
40
|
console.warn('"importOperationTypesFrom" should be used with "documentMode=external" and "importDocumentNodeExternallyFrom"');
|
|
38
41
|
}
|
package/package.json
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-apollo-angular",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha-20230524083052-08ce957b4",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating ready-to-use Angular Components 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"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@graphql-codegen/plugin-helpers": "^
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "^3.0.0",
|
|
10
10
|
"@graphql-codegen/visitor-plugin-common": "2.13.1",
|
|
11
11
|
"auto-bind": "~4.0.0",
|
|
12
|
-
"change-case-all": "1.0.
|
|
12
|
+
"change-case-all": "1.0.15",
|
|
13
13
|
"tslib": "~2.4.0"
|
|
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/apollo-angular"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">= 16.0.0"
|
|
23
|
+
},
|
|
21
24
|
"main": "cjs/index.js",
|
|
22
25
|
"module": "esm/index.js",
|
|
23
26
|
"typings": "typings/index.d.ts",
|
package/typings/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ApolloAngularVisitor } from './visitor.cjs';
|
|
1
|
+
import { PluginFunction, PluginValidateFn } from '@graphql-codegen/plugin-helpers';
|
|
3
2
|
import { ApolloAngularRawPluginConfig } from './config.cjs';
|
|
3
|
+
import { ApolloAngularVisitor } from './visitor.cjs';
|
|
4
4
|
export declare const plugin: PluginFunction<ApolloAngularRawPluginConfig>;
|
|
5
5
|
export declare const addToSchema: import("graphql").DocumentNode;
|
|
6
6
|
export declare const validate: PluginValidateFn<any>;
|
package/typings/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ApolloAngularVisitor } from './visitor.js';
|
|
1
|
+
import { PluginFunction, PluginValidateFn } from '@graphql-codegen/plugin-helpers';
|
|
3
2
|
import { ApolloAngularRawPluginConfig } from './config.js';
|
|
3
|
+
import { ApolloAngularVisitor } from './visitor.js';
|
|
4
4
|
export declare const plugin: PluginFunction<ApolloAngularRawPluginConfig>;
|
|
5
5
|
export declare const addToSchema: import("graphql").DocumentNode;
|
|
6
6
|
export declare const validate: PluginValidateFn<any>;
|
package/typings/visitor.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OperationDefinitionNode, GraphQLSchema } from 'graphql';
|
|
3
|
-
import { ApolloAngularRawPluginConfig } from './config.cjs';
|
|
1
|
+
import { GraphQLSchema, OperationDefinitionNode } from 'graphql';
|
|
4
2
|
import { Types } from '@graphql-codegen/plugin-helpers';
|
|
3
|
+
import { ClientSideBasePluginConfig, ClientSideBaseVisitor, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
|
|
4
|
+
import { ApolloAngularRawPluginConfig } from './config.cjs';
|
|
5
5
|
export interface ApolloAngularPluginConfig extends ClientSideBasePluginConfig {
|
|
6
6
|
apolloAngularVersion: number;
|
|
7
7
|
ngModule?: string;
|
package/typings/visitor.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OperationDefinitionNode, GraphQLSchema } from 'graphql';
|
|
3
|
-
import { ApolloAngularRawPluginConfig } from './config.js';
|
|
1
|
+
import { GraphQLSchema, OperationDefinitionNode } from 'graphql';
|
|
4
2
|
import { Types } from '@graphql-codegen/plugin-helpers';
|
|
3
|
+
import { ClientSideBasePluginConfig, ClientSideBaseVisitor, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
|
|
4
|
+
import { ApolloAngularRawPluginConfig } from './config.js';
|
|
5
5
|
export interface ApolloAngularPluginConfig extends ClientSideBasePluginConfig {
|
|
6
6
|
apolloAngularVersion: number;
|
|
7
7
|
ngModule?: string;
|