From 8bc7c2089c8d284fcae682485a6b53b6ad446154 Mon Sep 17 00:00:00 2001 From: Aravind K P Date: Fri, 16 Apr 2021 17:20:54 +0530 Subject: [PATCH] cli: fix errors being ignored on metadata apply GitOrigin-RevId: 1f526c70f57082aa968ebc3d957c78613e9a399e --- CHANGELOG.md | 1 + cli/commands/metadata.go | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78624884337..4f294b22f79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ In the future, we will probably offer a way to explicitly choose which behaviour - console: add custom_column_names to track_table request with replaced invalid characters (#992) - console: add details button to the success notification to see inserted row - console: add request preview for REST endpoints +- cli: fix errors being ignored during `metadata apply` in config v3 (fix #6784) ## v2.0.0-alpha.7 diff --git a/cli/commands/metadata.go b/cli/commands/metadata.go index 11defc5fe0a..d11ba55bc33 100644 --- a/cli/commands/metadata.go +++ b/cli/commands/metadata.go @@ -1,6 +1,8 @@ package commands import ( + "fmt" + "github.com/hasura/graphql-engine/cli" "github.com/hasura/graphql-engine/cli/internal/metadataobject" "github.com/hasura/graphql-engine/cli/internal/scripts" @@ -92,8 +94,9 @@ func executeMetadata(cmd string, ec *cli.ExecutionContext) error { } return nil } - - metadataHandler.V2ApplyMetadata() + if err := metadataHandler.V2ApplyMetadata(); err != nil { + return fmt.Errorf("\n%w", err) + } } return nil }