@graphql-codegen/typescript-apollo-angular 3.3.4-alpha-b385699c5.0 → 3.4.1-alpha-e6dadab0d.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 CHANGED
@@ -126,4 +126,15 @@ export interface ApolloAngularRawPluginConfig extends RawClientSideBasePluginCon
126
126
  * ```
127
127
  */
128
128
  additionalDI?: string[];
129
+ /**
130
+ * @description Add `override` modifier to make the generated code compatible with the `noImplicitOverride` option of Typescript v4.3+.
131
+ * @default false
132
+ *
133
+ * @exampleMarkdown
134
+ * ```yml
135
+ * config:
136
+ * addExplicitOverride: true
137
+ * ```
138
+ */
139
+ addExplicitOverride?: boolean;
129
140
  }
package/index.js CHANGED
@@ -33,6 +33,7 @@ class ApolloAngularVisitor extends visitorPluginCommon.ClientSideBaseVisitor {
33
33
  apolloAngularPackage: visitorPluginCommon.getConfigValue(rawConfig.apolloAngularPackage, 'apollo-angular'),
34
34
  apolloAngularVersion: visitorPluginCommon.getConfigValue(rawConfig.apolloAngularVersion, 2),
35
35
  gqlImport: visitorPluginCommon.getConfigValue(rawConfig.gqlImport, !rawConfig.apolloAngularVersion || rawConfig.apolloAngularVersion === 2 ? `apollo-angular#gql` : null),
36
+ addExplicitOverride: visitorPluginCommon.getConfigValue(rawConfig.addExplicitOverride, false),
36
37
  }, documents);
37
38
  this._allOperations = _allOperations;
38
39
  this._externalImportPrefix = '';
@@ -210,7 +211,7 @@ class ApolloAngularVisitor extends visitorPluginCommon.ClientSideBaseVisitor {
210
211
  providedIn: ${this._providedIn(node)}
211
212
  })
212
213
  export class ${serviceName} extends Apollo.${operationType}<${operationResultType}, ${operationVariablesTypes}> {
213
- document = ${this._getDocumentNodeVariable(node, documentVariableName)};
214
+ ${this.config.addExplicitOverride ? 'override ' : ''}document = ${this._getDocumentNodeVariable(node, documentVariableName)};
214
215
  ${this._namedClient(node)}
215
216
  constructor(${this.dependencyInjections}) {
216
217
  super(${this.dependencyInjectionArgs});
@@ -271,13 +272,13 @@ ${changeCaseAll.camelCase(o.node.name.value)}Watch(variables${optionalVariables
271
272
 
272
273
  interface WatchQueryOptionsAlone<V>
273
274
  extends Omit<ApolloCore.WatchQueryOptions<V>, 'query' | 'variables'> {}
274
-
275
+
275
276
  interface QueryOptionsAlone<V>
276
277
  extends Omit<ApolloCore.QueryOptions<V>, 'query' | 'variables'> {}
277
-
278
+
278
279
  interface MutationOptionsAlone<T, V>
279
280
  extends Omit<ApolloCore.MutationOptions<T, V>, 'mutation' | 'variables'> {}
280
-
281
+
281
282
  interface SubscriptionOptionsAlone<V>
282
283
  extends Omit<ApolloCore.SubscriptionOptions<V>, 'query' | 'variables'> {}
283
284
 
package/index.mjs CHANGED
@@ -27,6 +27,7 @@ class ApolloAngularVisitor extends ClientSideBaseVisitor {
27
27
  apolloAngularPackage: getConfigValue(rawConfig.apolloAngularPackage, 'apollo-angular'),
28
28
  apolloAngularVersion: getConfigValue(rawConfig.apolloAngularVersion, 2),
29
29
  gqlImport: getConfigValue(rawConfig.gqlImport, !rawConfig.apolloAngularVersion || rawConfig.apolloAngularVersion === 2 ? `apollo-angular#gql` : null),
30
+ addExplicitOverride: getConfigValue(rawConfig.addExplicitOverride, false),
30
31
  }, documents);
31
32
  this._allOperations = _allOperations;
32
33
  this._externalImportPrefix = '';
@@ -204,7 +205,7 @@ class ApolloAngularVisitor extends ClientSideBaseVisitor {
204
205
  providedIn: ${this._providedIn(node)}
205
206
  })
206
207
  export class ${serviceName} extends Apollo.${operationType}<${operationResultType}, ${operationVariablesTypes}> {
207
- document = ${this._getDocumentNodeVariable(node, documentVariableName)};
208
+ ${this.config.addExplicitOverride ? 'override ' : ''}document = ${this._getDocumentNodeVariable(node, documentVariableName)};
208
209
  ${this._namedClient(node)}
209
210
  constructor(${this.dependencyInjections}) {
210
211
  super(${this.dependencyInjectionArgs});
@@ -265,13 +266,13 @@ ${camelCase(o.node.name.value)}Watch(variables${optionalVariables ? '?' : ''}: $
265
266
 
266
267
  interface WatchQueryOptionsAlone<V>
267
268
  extends Omit<ApolloCore.WatchQueryOptions<V>, 'query' | 'variables'> {}
268
-
269
+
269
270
  interface QueryOptionsAlone<V>
270
271
  extends Omit<ApolloCore.QueryOptions<V>, 'query' | 'variables'> {}
271
-
272
+
272
273
  interface MutationOptionsAlone<T, V>
273
274
  extends Omit<ApolloCore.MutationOptions<T, V>, 'mutation' | 'variables'> {}
274
-
275
+
275
276
  interface SubscriptionOptionsAlone<V>
276
277
  extends Omit<ApolloCore.SubscriptionOptions<V>, 'query' | 'variables'> {}
277
278
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/typescript-apollo-angular",
3
- "version": "3.3.4-alpha-b385699c5.0",
3
+ "version": "3.4.1-alpha-e6dadab0d.0",
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",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@graphql-codegen/plugin-helpers": "^2.4.0",
11
- "@graphql-codegen/visitor-plugin-common": "2.7.0-alpha-b385699c5.0",
11
+ "@graphql-codegen/visitor-plugin-common": "2.7.1-alpha-e6dadab0d.0",
12
12
  "auto-bind": "~4.0.0",
13
13
  "change-case-all": "1.0.14",
14
14
  "tslib": "~2.3.0"
package/visitor.d.ts CHANGED
@@ -15,6 +15,7 @@ export interface ApolloAngularPluginConfig extends ClientSideBasePluginConfig {
15
15
  subscriptionSuffix?: string;
16
16
  apolloAngularPackage: string;
17
17
  additionalDI?: string[];
18
+ addExplicitOverride: boolean;
18
19
  }
19
20
  export declare class ApolloAngularVisitor extends ClientSideBaseVisitor<ApolloAngularRawPluginConfig, ApolloAngularPluginConfig> {
20
21
  private _allOperations;