Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Jul 25, 2022
1 parent 4764f68 commit 391a28d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 31 deletions.
15 changes: 8 additions & 7 deletions packages/mergers/stitching/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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,
Expand Down
20 changes: 10 additions & 10 deletions packages/store/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,20 @@ export enum PredefinedProxyOptionsName {
StringWithoutValidation = 'StringWithoutValidation',
}

export const PredefinedProxyOptions: Record<PredefinedProxyOptionsName, ProxyOptions<any>> = {
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) {}
Expand Down
14 changes: 0 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2910,15 +2910,6 @@
parse-filepath "^1.0.2"
tslib "~2.4.0"

"@graphql-inspector/[email protected]":
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/[email protected]":
version "8.3.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/batch-delegate/-/batch-delegate-8.3.0.tgz#9ceaccb60788bfdd0ab3f1ad84e0ddb76e89190b"
Expand Down Expand Up @@ -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==

[email protected]:
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"
Expand Down

0 comments on commit 391a28d

Please sign in to comment.