feat: add full SDL to SupGraph response
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user