feat: add full SDL to SupGraph response

This commit is contained in:
2024-03-25 21:46:15 +01:00
parent be878a3f2a
commit 6cd3b935e4
5 changed files with 77 additions and 0 deletions
+14
View File
@@ -163,9 +163,23 @@ func (r *queryResolver) Supergraph(ctx context.Context, ref string, isAfter *str
ChangedAt: sg.ChangedAt,
}
}
var serviceSDLs []string
for _, id := range services {
sg, err := r.fetchSubGraph(ctx, id)
if err != nil {
return nil, err
}
serviceSDLs = append(serviceSDLs, sg.Sdl)
}
sdl, err := sdlmerge.MergeSDLs(serviceSDLs...)
if err != nil {
return nil, err
}
return &model.SubGraphs{
ID: lastUpdate,
SubGraphs: subGraphs,
Sdl: sdl,
MinDelaySeconds: 10,
}, nil
}