cli: remove the unnecessary empty lines in actions.graphql generated by metadata export command

closes https://github.com/hasura/graphql-engine/issues/5338

GitOrigin-RevId: 83bd8492beb9f52c761d5857ca369425c69691a4
This commit is contained in:
Kali Vara Purushotham Santhati 2021-06-09 16:15:13 +05:30 committed by hasura-bot
parent dc950eda6a
commit 8bfc56b7c4
8 changed files with 5 additions and 17 deletions

View File

@ -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

View File

@ -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;
}