Files
schemas/graph/schema.helpers.go
argoyle 73eae98929
schemas / vulnerabilities (pull_request) Successful in 2m15s
schemas / check-release (pull_request) Successful in 2m17s
schemas / check (pull_request) Successful in 4m48s
pre-commit / pre-commit (pull_request) Successful in 5m58s
schemas / build (pull_request) Successful in 3m36s
schemas / deploy-prod (pull_request) Has been skipped
feat: migrate from GitLab CI to Gitea Actions
- 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>
2026-01-17 22:53:46 +01:00

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
}