2022-10-09 15:23:52 +02:00
|
|
|
package graph
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"gitlab.com/unboundsoftware/eventsourced/eventsourced"
|
|
|
|
|
|
|
|
|
|
"gitlab.com/unboundsoftware/schemas/domain"
|
2022-10-14 22:41:56 +02:00
|
|
|
"gitlab.com/unboundsoftware/schemas/graph/model"
|
2022-10-09 15:23:52 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func (r *Resolver) fetchSubGraph(subGraphId string) (*domain.SubGraph, error) {
|
|
|
|
|
subGraph := &domain.SubGraph{BaseAggregate: eventsourced.BaseAggregateFromString(subGraphId)}
|
|
|
|
|
_, err := r.handler(subGraph)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return subGraph, nil
|
|
|
|
|
}
|
2022-10-14 22:41:56 +02:00
|
|
|
|
|
|
|
|
func (r *Resolver) toGqlSubGraph(subGraph *domain.SubGraph) *model.SubGraph {
|
|
|
|
|
return &model.SubGraph{
|
|
|
|
|
ID: subGraph.ID.String(),
|
|
|
|
|
Service: subGraph.Service,
|
|
|
|
|
URL: subGraph.Url,
|
|
|
|
|
WsURL: subGraph.WSUrl,
|
|
|
|
|
Sdl: subGraph.Sdl,
|
|
|
|
|
ChangedBy: subGraph.ChangedBy,
|
|
|
|
|
ChangedAt: subGraph.ChangedAt,
|
|
|
|
|
}
|
|
|
|
|
}
|