chore: handle push of unchanged schema
This commit is contained in:
+14
-9
@@ -2,6 +2,7 @@ package ctl
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
@@ -47,15 +48,19 @@ func List(apiKey, schemaRef, service string, schemasUrl url.URL) ([]*SubGraph, e
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
subGraphs := make([]*SubGraph, len(response.SubGraphs))
|
||||
for i, subGraph := range response.SubGraphs {
|
||||
subGraphs[i] = &SubGraph{
|
||||
Service: subGraph.Service,
|
||||
URL: subGraph.Url,
|
||||
WSUrl: subGraph.WsUrl,
|
||||
ChangedBy: subGraph.ChangedBy,
|
||||
ChangedAt: subGraph.ChangedAt,
|
||||
var subGraphs []*SubGraph
|
||||
if s, ok := response.Supergraph.(*SubGraphsSupergraphSubGraphs); ok {
|
||||
subGraphs = make([]*SubGraph, len(s.SubGraphs))
|
||||
for i, subGraph := range s.SubGraphs {
|
||||
subGraphs[i] = &SubGraph{
|
||||
Service: subGraph.Service,
|
||||
URL: subGraph.Url,
|
||||
WSUrl: subGraph.WsUrl,
|
||||
ChangedBy: subGraph.ChangedBy,
|
||||
ChangedAt: subGraph.ChangedAt,
|
||||
}
|
||||
}
|
||||
return subGraphs, nil
|
||||
}
|
||||
return subGraphs, nil
|
||||
return nil, fmt.Errorf("unexpected response type")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user