chore: add context and error handling

This commit is contained in:
argoyle committed 2022-12-17 14:36:42 +01:00
1 parent 80d3c44cb0
commit 98a679d2d3
4 files changed
+23 -16

No files matched your search

+4 -2
View File
@@ -1,15 +1,17 @@
package graph
import (
"context"
"gitlab.com/unboundsoftware/eventsourced/eventsourced"
"gitlab.com/unboundsoftware/schemas/domain"
"gitlab.com/unboundsoftware/schemas/graph/model"
)
func (r *Resolver) fetchSubGraph(subGraphId string) (*domain.SubGraph, error) {
func (r *Resolver) fetchSubGraph(ctx context.Context, subGraphId string) (*domain.SubGraph, error) {
subGraph := &domain.SubGraph{BaseAggregate: eventsourced.BaseAggregateFromString(subGraphId)}
_, err := r.handler(subGraph)
_, err := r.handler(ctx, subGraph)
if err != nil {
return nil, err
}