@graphql-codegen/plugin-helpers 7.0.0 → 7.0.1

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
@@ -25,7 +25,7 @@ exports.federationSpec = (0, graphql_1.parse)(/* GraphQL */ `
25
25
  * - return type
26
26
  * @param schema
27
27
  */
28
- function addFederationReferencesToSchema(schema) {
28
+ function addFederationReferencesToSchema(schema, config) {
29
29
  const setFederationMeta = ({ meta, typeName, update, }) => {
30
30
  meta[typeName] = {
31
31
  ...(meta[typeName] ||
@@ -164,7 +164,7 @@ function addFederationReferencesToSchema(schema) {
164
164
  });
165
165
  const referenceSelectionSetsString = printReferenceSelectionSets({
166
166
  typeName: type.name,
167
- baseFederationType: `FederationTypes['${type.name}']`, // FIXME: run convertName on FederationTypes
167
+ baseFederationType: `${config.convertName('FederationTypes')}['${type.name}']`,
168
168
  referenceSelectionSets,
169
169
  });
170
170
  setFederationMeta({
@@ -198,7 +198,7 @@ function addFederationReferencesToSchema(schema) {
198
198
  };
199
199
  const referenceSelectionSetsString = printReferenceSelectionSets({
200
200
  typeName: type.name,
201
- baseFederationType: `FederationTypes['${type.name}']`, // FIXME: run convertName on FederationTypes
201
+ baseFederationType: `${config.convertName('FederationTypes')}['${type.name}']`,
202
202
  referenceSelectionSets,
203
203
  });
204
204
  setFederationMeta({
package/esm/federation.js CHANGED
@@ -20,7 +20,7 @@ export const federationSpec = parse(/* GraphQL */ `
20
20
  * - return type
21
21
  * @param schema
22
22
  */
23
- export function addFederationReferencesToSchema(schema) {
23
+ export function addFederationReferencesToSchema(schema, config) {
24
24
  const setFederationMeta = ({ meta, typeName, update, }) => {
25
25
  meta[typeName] = {
26
26
  ...(meta[typeName] ||
@@ -159,7 +159,7 @@ export function addFederationReferencesToSchema(schema) {
159
159
  });
160
160
  const referenceSelectionSetsString = printReferenceSelectionSets({
161
161
  typeName: type.name,
162
- baseFederationType: `FederationTypes['${type.name}']`, // FIXME: run convertName on FederationTypes
162
+ baseFederationType: `${config.convertName('FederationTypes')}['${type.name}']`,
163
163
  referenceSelectionSets,
164
164
  });
165
165
  setFederationMeta({
@@ -193,7 +193,7 @@ export function addFederationReferencesToSchema(schema) {
193
193
  };
194
194
  const referenceSelectionSetsString = printReferenceSelectionSets({
195
195
  typeName: type.name,
196
- baseFederationType: `FederationTypes['${type.name}']`, // FIXME: run convertName on FederationTypes
196
+ baseFederationType: `${config.convertName('FederationTypes')}['${type.name}']`,
197
197
  referenceSelectionSets,
198
198
  });
199
199
  setFederationMeta({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/plugin-helpers",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
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"
@@ -32,7 +32,9 @@ export type FederationMeta = {
32
32
  * - return type
33
33
  * @param schema
34
34
  */
35
- export declare function addFederationReferencesToSchema(schema: GraphQLSchema): {
35
+ export declare function addFederationReferencesToSchema(schema: GraphQLSchema, config: {
36
+ convertName: (type: string) => string;
37
+ }): {
36
38
  transformedSchema: GraphQLSchema;
37
39
  federationMeta: FederationMeta;
38
40
  };
@@ -32,7 +32,9 @@ export type FederationMeta = {
32
32
  * - return type
33
33
  * @param schema
34
34
  */
35
- export declare function addFederationReferencesToSchema(schema: GraphQLSchema): {
35
+ export declare function addFederationReferencesToSchema(schema: GraphQLSchema, config: {
36
+ convertName: (type: string) => string;
37
+ }): {
36
38
  transformedSchema: GraphQLSchema;
37
39
  federationMeta: FederationMeta;
38
40
  };