Use version.compositeSchemaSDL instead of keep recomposing the schema (#3329)

This commit is contained in:
Kamil Kisiela 2023-11-09 09:40:03 +01:00 committed by GitHub
parent 1575d93751
commit bc06103cf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -36,6 +36,15 @@ export const resolvers: LabModule.Resolvers = {
return null;
}
if (latestSchema.compositeSchemaSDL) {
return {
schema: latestSchema.compositeSchemaSDL,
mocks: {},
};
}
// Legacy Fallback
const [
schemas,
{ type, externalComposition, nativeFederation, legacyRegistryModel },

View file

@ -935,6 +935,12 @@ export const resolvers: SchemaModule.Resolvers = {
.then(r => r.supergraph);
},
async sdl(version, _, { injector }) {
if (version.compositeSchemaSDL) {
return version.compositeSchemaSDL;
}
// Legacy Fallback
const [project, organization] = await Promise.all([
injector.get(ProjectManager).getProject({
organization: version.organization,