From 391a28d6f73b7b279ca9fcacf45273e3094333ea Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Mon, 25 Jul 2022 18:19:58 +0300 Subject: [PATCH] Fix build --- packages/mergers/stitching/src/index.ts | 15 ++++++++------- packages/store/src/index.ts | 20 ++++++++++---------- yarn.lock | 14 -------------- 3 files changed, 18 insertions(+), 31 deletions(-) diff --git a/packages/mergers/stitching/src/index.ts b/packages/mergers/stitching/src/index.ts index e148f887f8d93..2155a66f9fc08 100644 --- a/packages/mergers/stitching/src/index.ts +++ b/packages/mergers/stitching/src/index.ts @@ -49,8 +49,8 @@ export default class StitchingMerger implements MeshMerger { rawSourceLogger.debug(`Extracting existing resolvers if available`); const resolvers = extractResolvers(oldSchema); - let newSchema = await this.store - .proxy(`${name}_stitching`, PredefinedProxyOptions.GraphQLSchemaWithDiffing) + const sdl = await this.store + .proxy(`${name}_stitching`, PredefinedProxyOptions.StringWithoutValidation) .getWithSet(async () => { this.logger.debug(`Fetching Apollo Federated Service SDL for ${name}`); const sdlQueryResult: any = (await executor({ @@ -61,13 +61,14 @@ export default class StitchingMerger implements MeshMerger { } const federationSdl = sdlQueryResult.data._service.sdl; this.logger.debug(`Generating Stitching SDL for ${name}`); - const stitchingSdl = federationToStitchingSDL(federationSdl, stitchingDirectives); - return buildSchema(stitchingSdl, { - assumeValid: true, - assumeValidSDL: true, - }); + return federationToStitchingSDL(federationSdl, stitchingDirectives); }); + let newSchema = buildSchema(sdl, { + assumeValid: true, + assumeValidSDL: true, + }); + rawSourceLogger.debug(`Adding existing resolvers back to the schema`); newSchema = addResolversToSchema({ schema: newSchema, diff --git a/packages/store/src/index.ts b/packages/store/src/index.ts index fde8f9694519d..82e3339f14c98 100644 --- a/packages/store/src/index.ts +++ b/packages/store/src/index.ts @@ -108,20 +108,20 @@ export enum PredefinedProxyOptionsName { StringWithoutValidation = 'StringWithoutValidation', } -export const PredefinedProxyOptions: Record> = { +export const PredefinedProxyOptions = { JsonWithoutValidation: { - codify: v => `export default ${JSON.stringify(v, null, 2)}`, - fromJSON: v => v, - toJSON: v => v, - validate: () => null, + codify: (v: any) => `export default ${JSON.stringify(v, null, 2)}`, + fromJSON: (v: any) => v, + toJSON: (v: any) => v, + validate: (): void => null, }, StringWithoutValidation: { - codify: v => `export default ${JSON.stringify(v, null, 2)}`, - fromJSON: v => v, - toJSON: v => v, - validate: () => null, + codify: (v: string) => `export default ${JSON.stringify(v, null, 2)}`, + fromJSON: (v: string) => v, + toJSON: (v: string) => v, + validate: (): void => null, }, -}; +} as const; export class MeshStore { constructor(public identifier: string, protected storage: StoreStorageAdapter, public flags: StoreFlags) {} diff --git a/yarn.lock b/yarn.lock index 2870c5a36639f..3c3bdf51bf7a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2910,15 +2910,6 @@ parse-filepath "^1.0.2" tslib "~2.4.0" -"@graphql-inspector/core@3.3.0": - version "3.3.0" - resolved "https://registry.yarnpkg.com/@graphql-inspector/core/-/core-3.3.0.tgz#3982909cec46a5b3050a8265569503f20a3b5742" - integrity sha512-LRtk9sHgj9qqVPIkkThAVq3iZ7QxgHCx6elEwd0eesZBCmaIYQxD/BFu+VT8jr10YfOURBZuAnVdyGu64vYpBg== - dependencies: - dependency-graph "0.11.0" - object-inspect "1.10.3" - tslib "^2.0.0" - "@graphql-tools/batch-delegate@8.3.0": version "8.3.0" resolved "https://registry.yarnpkg.com/@graphql-tools/batch-delegate/-/batch-delegate-8.3.0.tgz#9ceaccb60788bfdd0ab3f1ad84e0ddb76e89190b" @@ -18177,11 +18168,6 @@ object-hash@^2.2.0: resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.2.0.tgz#5ad518581eefc443bd763472b8ff2e9c2c0d54a5" integrity sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw== -object-inspect@1.10.3: - version "1.10.3" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.3.tgz#c2aa7d2d09f50c99375704f7a0adf24c5782d369" - integrity sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw== - object-inspect@^1.11.0, object-inspect@^1.12.2, object-inspect@^1.9.0: version "1.12.2" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea"