diff --git a/CHANGELOG.md b/CHANGELOG.md index a5c9496aa9c..e216151edff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ - console: allow tracking of custom SQL functions having composite type (rowtype) input arguments - console: allow input object presets in remote schema permissions - cli: add interactive prompt to get input when `--database-name` flag is missing - +- cli: fix metadata export to avoid unnecessary empty lines in actions.graphql (#5338) ## v2.0.0-beta.1 diff --git a/cli-ext/src/services/sdl/to/handler.js b/cli-ext/src/services/sdl/to/handler.js index ad69d46bcd6..b8ff17f38b7 100644 --- a/cli-ext/src/services/sdl/to/handler.js +++ b/cli-ext/src/services/sdl/to/handler.js @@ -31,23 +31,23 @@ const handlePayload = (payload) => { a.definition.type, a.definition.arguments, a.definition.output_type, - )}\n`; + )}`; }); } catch (e) { actionSdlError = e; } } + let sdl = `${actionSdl}`; if (types) { try { typesSdl = getTypesSdl(types); + sdl = `${sdl}${typesSdl}`; } catch (e) { typesSdlError = e; } } - let sdl = `${actionSdl}\n\n${typesSdl}`; - if (toDeriveOperation) { try { const derivation = deriveAction( @@ -62,7 +62,7 @@ const handlePayload = (payload) => { derivation.action.output_type, ); const derivedTypesSdl = getTypesSdl(derivation.types); - sdl = `${derivedActionSdl}\n\n${derivedTypesSdl}\n\n${sdl}`; + sdl = `${derivedActionSdl}${derivedTypesSdl}${sdl}`; } catch (e) { deriveActionError = e; } diff --git a/cli/commands/testdata/config-v2-test-project/metadata/actions.graphql b/cli/commands/testdata/config-v2-test-project/metadata/actions.graphql index 139597f9cb0..e69de29bb2d 100644 --- a/cli/commands/testdata/config-v2-test-project/metadata/actions.graphql +++ b/cli/commands/testdata/config-v2-test-project/metadata/actions.graphql @@ -1,2 +0,0 @@ - - diff --git a/cli/commands/testdata/config-v3-test-project/metadata/actions.graphql b/cli/commands/testdata/config-v3-test-project/metadata/actions.graphql index 139597f9cb0..e69de29bb2d 100644 --- a/cli/commands/testdata/config-v3-test-project/metadata/actions.graphql +++ b/cli/commands/testdata/config-v3-test-project/metadata/actions.graphql @@ -1,2 +0,0 @@ - - diff --git a/cli/integration_test/v2/metadata/latest/1_metadata/actions.graphql b/cli/integration_test/v2/metadata/latest/1_metadata/actions.graphql index 139597f9cb0..e69de29bb2d 100644 --- a/cli/integration_test/v2/metadata/latest/1_metadata/actions.graphql +++ b/cli/integration_test/v2/metadata/latest/1_metadata/actions.graphql @@ -1,2 +0,0 @@ - - diff --git a/cli/integration_test/v2/metadata/latest/2_metadata/actions.graphql b/cli/integration_test/v2/metadata/latest/2_metadata/actions.graphql index 139597f9cb0..e69de29bb2d 100644 --- a/cli/integration_test/v2/metadata/latest/2_metadata/actions.graphql +++ b/cli/integration_test/v2/metadata/latest/2_metadata/actions.graphql @@ -1,2 +0,0 @@ - - diff --git a/cli/integration_test/v3/metadata/latest/1_metadata/actions.graphql b/cli/integration_test/v3/metadata/latest/1_metadata/actions.graphql index 139597f9cb0..e69de29bb2d 100644 --- a/cli/integration_test/v3/metadata/latest/1_metadata/actions.graphql +++ b/cli/integration_test/v3/metadata/latest/1_metadata/actions.graphql @@ -1,2 +0,0 @@ - - diff --git a/cli/integration_test/v3/metadata/latest/2_metadata/actions.graphql b/cli/integration_test/v3/metadata/latest/2_metadata/actions.graphql index 139597f9cb0..e69de29bb2d 100644 --- a/cli/integration_test/v3/metadata/latest/2_metadata/actions.graphql +++ b/cli/integration_test/v3/metadata/latest/2_metadata/actions.graphql @@ -1,2 +0,0 @@ - -