bba1e8eba7
schemas / check-release (pull_request) Failing after 1m31s
schemas / vulnerabilities (pull_request) Successful in 2m19s
schemas / check (pull_request) Successful in 4m28s
schemas / build (pull_request) Has been skipped
schemas / deploy-prod (pull_request) Has been skipped
pre-commit / pre-commit (pull_request) Successful in 6m3s
- Update git remote to git.unbound.se - Add Gitea workflows: ci.yaml, pre-commit.yaml, release.yaml, goreleaser.yaml - Delete .gitlab-ci.yml - Update Go module path to gitea.unbound.se/unboundsoftware/schemas - Update all imports to new module path - Update Docker registry to oci.unbound.se - Update .goreleaser.yml for Gitea releases with internal cluster URL - Remove GitLab CI linter from pre-commit config - Use shared release workflow with tag_only for versioning Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
42 lines
998 B
Go
42 lines
998 B
Go
package graph
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitlab.com/unboundsoftware/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
|
|
}
|