Unbound Release / Check Preconditions (push) Successful in 34s
Unbound Release / Create Release (push) Skipped
schemas / vulnerabilities (push) Successful in 1m9s
schemas / check-release (push) Successful in 57s
Unbound Release / Generate Changelog and Handle PR (push) Successful in 39s
Unbound Release / Create Tag (push) Successful in 33s
Release / release (push) Successful in 1m25s
schemas / check (push) Successful in 1m34s
pre-commit / pre-commit (push) Successful in 3m17s
schemas / build (push) Successful in 6m34s
schemas / deploy-prod (push) Successful in 1m11s
42 lines
984 B
Go
42 lines
984 B
Go
package graph
|
|
|
|
import (
|
|
"context"
|
|
|
|
"codeberg.org/eventsourced/eventsourced"
|
|
|
|
"gitea.unbound.se/unboundsoftware/schemas/domain"
|
|
"gitea.unbound.se/unboundsoftware/schemas/graph/model"
|
|
)
|
|
|
|
func (r *Resolver) fetchSubGraph(ctx context.Context, subGraphId string) (*domain.SubGraph, error) {
|
|
subGraph := &domain.SubGraph{BaseAggregate: eventsourced.BaseAggregateFromString(subGraphId)}
|
|
_, err := r.handler(ctx, subGraph)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return subGraph, nil
|
|
}
|
|
|
|
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,
|
|
}
|
|
}
|
|
|
|
func (r *Resolver) stringEqual(s1, s2 *string) bool {
|
|
if s1 == nil && s2 == nil {
|
|
return true
|
|
}
|
|
if s1 != nil && s2 != nil && *s1 == *s2 {
|
|
return true
|
|
}
|
|
return false
|
|
}
|