From 7cef9d2f875738a5b52159e967b7be08b3af4ce9 Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Tue, 5 May 2026 11:04:13 +0200 Subject: [PATCH] style: apply gofumpt formatting --- graph/cosmo.go | 3 ++- graph/schema.resolvers.go | 27 ++++++++++++++++++--------- rand/string.go | 3 ++- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/graph/cosmo.go b/graph/cosmo.go index 7f04893..77ee114 100644 --- a/graph/cosmo.go +++ b/graph/cosmo.go @@ -109,7 +109,8 @@ func GenerateCosmoRouterConfigWithExecutor(subGraphs []*model.SubGraph, executor // Execute wgc router compose // wgc is installed globally in the Docker image outputFile := filepath.Join(tmpDir, "config.json") - output, err := executor.Execute("wgc", "router", "compose", + output, err := executor.Execute( + "wgc", "router", "compose", "--input", inputFile, "--out", outputFile, "--suppress-warnings", diff --git a/graph/schema.resolvers.go b/graph/schema.resolvers.go index e9c302a..9b3a49b 100644 --- a/graph/schema.resolvers.go +++ b/graph/schema.resolvers.go @@ -178,7 +178,8 @@ func (r *mutationResolver) UpdateSubGraph(ctx context.Context, input model.Input // same org+ref only trigger one config generation. r.Debouncer.Debounce(orgId+":"+input.Ref, func() { services, lastUpdate := r.Cache.Services(orgId, input.Ref, "") - r.Logger.Info("Publishing schema update after subgraph change", + r.Logger.Info( + "Publishing schema update after subgraph change", "ref", input.Ref, "orgId", orgId, "lastUpdate", lastUpdate, @@ -210,7 +211,8 @@ func (r *mutationResolver) UpdateSubGraph(ctx context.Context, input model.Input CosmoRouterConfig: &cosmoConfig, } - r.Logger.Info("Publishing schema update to subscribers", + r.Logger.Info( + "Publishing schema update to subscribers", "ref", update.Ref, "id", update.ID, "subGraphsCount", len(update.SubGraphs), @@ -246,7 +248,8 @@ func (r *queryResolver) Supergraph(ctx context.Context, ref string, isAfter *str orgId := middleware.OrganizationFromContext(ctx) userId := middleware.UserFromContext(ctx) - r.Logger.Info("Supergraph query", + r.Logger.Info( + "Supergraph query", "ref", ref, "orgId", orgId, "userId", userId, @@ -312,7 +315,8 @@ func (r *queryResolver) LatestSchema(ctx context.Context, ref string) (*model.Sc orgId := middleware.OrganizationFromContext(ctx) userId := middleware.UserFromContext(ctx) - r.Logger.Info("LatestSchema query", + r.Logger.Info( + "LatestSchema query", "ref", ref, "orgId", orgId, "userId", userId, @@ -342,7 +346,8 @@ func (r *queryResolver) LatestSchema(ctx context.Context, ref string) (*model.Sc // Get current services and schema services, lastUpdate := r.Cache.Services(orgId, ref, "") - r.Logger.Info("Fetching latest schema", + r.Logger.Info( + "Fetching latest schema", "ref", ref, "orgId", orgId, "lastUpdate", lastUpdate, @@ -381,7 +386,8 @@ func (r *queryResolver) LatestSchema(ctx context.Context, ref string) (*model.Sc CosmoRouterConfig: &cosmoConfig, } - r.Logger.Info("Latest schema fetched", + r.Logger.Info( + "Latest schema fetched", "ref", update.Ref, "id", update.ID, "subGraphsCount", len(update.SubGraphs), @@ -395,7 +401,8 @@ func (r *queryResolver) LatestSchema(ctx context.Context, ref string) (*model.Sc func (r *subscriptionResolver) SchemaUpdates(ctx context.Context, ref string) (<-chan *model.SchemaUpdate, error) { orgId := middleware.OrganizationFromContext(ctx) - r.Logger.Info("SchemaUpdates subscription started", + r.Logger.Info( + "SchemaUpdates subscription started", "ref", ref, "orgId", orgId, ) @@ -412,7 +419,8 @@ func (r *subscriptionResolver) SchemaUpdates(ctx context.Context, ref string) (< // Send initial state immediately go func() { services, lastUpdate := r.Cache.Services(orgId, ref, "") - r.Logger.Info("Preparing initial schema update", + r.Logger.Info( + "Preparing initial schema update", "ref", ref, "orgId", orgId, "lastUpdate", lastUpdate, @@ -444,7 +452,8 @@ func (r *subscriptionResolver) SchemaUpdates(ctx context.Context, ref string) (< CosmoRouterConfig: &cosmoConfig, } - r.Logger.Info("Sending initial schema update", + r.Logger.Info( + "Sending initial schema update", "ref", update.Ref, "id", update.ID, "subGraphsCount", len(update.SubGraphs), diff --git a/rand/string.go b/rand/string.go index 7f4acd2..e92a15c 100644 --- a/rand/string.go +++ b/rand/string.go @@ -9,7 +9,8 @@ const charset = "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" var seededRand *rand.Rand = rand.New( - rand.NewSource(time.Now().UnixNano())) + rand.NewSource(time.Now().UnixNano()), +) func StringWithCharset(length int, charset string) string { b := make([]byte, length)