From 1d4165a96b1e161f8e334be1db48ed7fe12a4225 Mon Sep 17 00:00:00 2001 From: Benjamin DENEUX Date: Mon, 24 Jun 2024 07:55:31 +0200 Subject: [PATCH] feat(go): generate query grpc clients --- magefiles/build.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/magefiles/build.go b/magefiles/build.go index 7ef7122..0294abe 100644 --- a/magefiles/build.go +++ b/magefiles/build.go @@ -67,6 +67,16 @@ func (Build) Go(schema string) error { return fmt.Errorf("failed to generate go types: %w", err) } + fmt.Println("👨‍💻 Generate go client") + err = sh.Run("go-codegen", "generate", + "query-client", + filepath.Join(SCHEMA_DIR, fmt.Sprintf("%s.json", schema)), + "-o", filepath.Join(dest, "client.go"), + "--package-name", "schema") + if err != nil { + return fmt.Errorf("failed to generate go client: %w", err) + } + fmt.Println("🔨 Building go") return runInPath(dest, "go", "build") }