@graphql-codegen/plugin-helpers 5.1.0 → 5.1.1-alpha-20241210130701-70a8f367ec2e1cb6cfe466c92be5f0497c2b857b

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/federation.js CHANGED
@@ -125,7 +125,7 @@ class ApolloFederation {
125
125
  * Transforms ParentType signature in ObjectTypes involved in Federation
126
126
  * @param data
127
127
  */
128
- transformParentType({ fieldNode, parentType, parentTypeSignature, }) {
128
+ transformParentType({ fieldNode, parentType, parentTypeSignature, federationTypeSignature, }) {
129
129
  if (this.enabled &&
130
130
  (0, graphql_1.isObjectType)(parentType) &&
131
131
  (isTypeExtension(parentType, this.schema) || fieldNode.name.value === resolveReferenceFieldName)) {
@@ -138,11 +138,11 @@ class ApolloFederation {
138
138
  const outputs = [`{ __typename: '${parentType.name}' } &`];
139
139
  // Look for @requires and see what the service needs and gets
140
140
  const requires = getDirectivesByName('requires', fieldNode).map(this.extractFieldSet);
141
- const requiredFields = this.translateFieldSet((0, merge_js_1.default)({}, ...requires), parentTypeSignature);
141
+ const requiredFields = this.translateFieldSet((0, merge_js_1.default)({}, ...requires), federationTypeSignature);
142
142
  // @key() @key() - "primary keys" in Federation
143
143
  const primaryKeys = resolvableKeyDirectives.map(def => {
144
144
  const fields = this.extractFieldSet(def);
145
- return this.translateFieldSet(fields, parentTypeSignature);
145
+ return this.translateFieldSet(fields, federationTypeSignature);
146
146
  });
147
147
  const [open, close] = primaryKeys.length > 1 ? ['(', ')'] : ['', ''];
148
148
  outputs.push([open, primaryKeys.join(' | '), close].join(''));
package/esm/federation.js CHANGED
@@ -118,7 +118,7 @@ export class ApolloFederation {
118
118
  * Transforms ParentType signature in ObjectTypes involved in Federation
119
119
  * @param data
120
120
  */
121
- transformParentType({ fieldNode, parentType, parentTypeSignature, }) {
121
+ transformParentType({ fieldNode, parentType, parentTypeSignature, federationTypeSignature, }) {
122
122
  if (this.enabled &&
123
123
  isObjectType(parentType) &&
124
124
  (isTypeExtension(parentType, this.schema) || fieldNode.name.value === resolveReferenceFieldName)) {
@@ -131,11 +131,11 @@ export class ApolloFederation {
131
131
  const outputs = [`{ __typename: '${parentType.name}' } &`];
132
132
  // Look for @requires and see what the service needs and gets
133
133
  const requires = getDirectivesByName('requires', fieldNode).map(this.extractFieldSet);
134
- const requiredFields = this.translateFieldSet(merge({}, ...requires), parentTypeSignature);
134
+ const requiredFields = this.translateFieldSet(merge({}, ...requires), federationTypeSignature);
135
135
  // @key() @key() - "primary keys" in Federation
136
136
  const primaryKeys = resolvableKeyDirectives.map(def => {
137
137
  const fields = this.extractFieldSet(def);
138
- return this.translateFieldSet(fields, parentTypeSignature);
138
+ return this.translateFieldSet(fields, federationTypeSignature);
139
139
  });
140
140
  const [open, close] = primaryKeys.length > 1 ? ['(', ')'] : ['', ''];
141
141
  outputs.push([open, primaryKeys.join(' | '), close].join(''));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/plugin-helpers",
3
- "version": "5.1.0",
3
+ "version": "5.1.1-alpha-20241210130701-70a8f367ec2e1cb6cfe466c92be5f0497c2b857b",
4
4
  "description": "GraphQL Code Generator common utils and types",
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"
@@ -61,10 +61,11 @@ export declare class ApolloFederation {
61
61
  * Transforms ParentType signature in ObjectTypes involved in Federation
62
62
  * @param data
63
63
  */
64
- transformParentType({ fieldNode, parentType, parentTypeSignature, }: {
64
+ transformParentType({ fieldNode, parentType, parentTypeSignature, federationTypeSignature, }: {
65
65
  fieldNode: FieldDefinitionNode;
66
66
  parentType: GraphQLNamedType;
67
67
  parentTypeSignature: string;
68
+ federationTypeSignature: string;
68
69
  }): string;
69
70
  setMeta(typename: string, update: Partial<TypeMeta>): void;
70
71
  getMeta(): {
@@ -61,10 +61,11 @@ export declare class ApolloFederation {
61
61
  * Transforms ParentType signature in ObjectTypes involved in Federation
62
62
  * @param data
63
63
  */
64
- transformParentType({ fieldNode, parentType, parentTypeSignature, }: {
64
+ transformParentType({ fieldNode, parentType, parentTypeSignature, federationTypeSignature, }: {
65
65
  fieldNode: FieldDefinitionNode;
66
66
  parentType: GraphQLNamedType;
67
67
  parentTypeSignature: string;
68
+ federationTypeSignature: string;
68
69
  }): string;
69
70
  setMeta(typename: string, update: Partial<TypeMeta>): void;
70
71
  getMeta(): {
@@ -282,7 +282,7 @@ export declare namespace Types {
282
282
  */
283
283
  schema?: InstanceOrArray<Schema>;
284
284
  /**
285
- * @description Configuration object containing key => value that will be passes to the plugins.
285
+ * @description Configuration object containing key => value that will be passed to the plugins.
286
286
  * Specifying configuration in this level of your configuration file will pass it to all plugins, in all outputs.
287
287
  *
288
288
  * The options may vary depends on what plugins you are using.
@@ -386,7 +386,7 @@ export declare namespace Types {
386
386
  /**
387
387
  * @type object
388
388
  * @additionalProperties true
389
- * @description Configuration object containing key => value that will be passes to the plugins.
389
+ * @description Configuration object containing key => value that will be passed to the plugins.
390
390
  * Specifying configuration in this level of your configuration file will pass it to all plugins, in all outputs.
391
391
  *
392
392
  * The options may vary depends on what plugins you are using.
@@ -282,7 +282,7 @@ export declare namespace Types {
282
282
  */
283
283
  schema?: InstanceOrArray<Schema>;
284
284
  /**
285
- * @description Configuration object containing key => value that will be passes to the plugins.
285
+ * @description Configuration object containing key => value that will be passed to the plugins.
286
286
  * Specifying configuration in this level of your configuration file will pass it to all plugins, in all outputs.
287
287
  *
288
288
  * The options may vary depends on what plugins you are using.
@@ -386,7 +386,7 @@ export declare namespace Types {
386
386
  /**
387
387
  * @type object
388
388
  * @additionalProperties true
389
- * @description Configuration object containing key => value that will be passes to the plugins.
389
+ * @description Configuration object containing key => value that will be passed to the plugins.
390
390
  * Specifying configuration in this level of your configuration file will pass it to all plugins, in all outputs.
391
391
  *
392
392
  * The options may vary depends on what plugins you are using.