Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Errors from post deployment hooks are swallowed and execution continues #2362

Closed
marktani opened this issue May 6, 2018 · 3 comments
Closed

Comments

@marktani
Copy link
Contributor

marktani commented May 6, 2018

Bug Report

Current behavior

If a post deployment hook returns with error, the errors is swallowed and the next deployment hook is executed.

Reproduction

Have this .graphqlconfig.yml:

projects:
  app:
    schemaPath: "src/schema.graphql"
    extensions:
      endpoints:
        default: "http://localhost:4000"
  prisma:
    schemaPath: "src/generated/prisma.graphqls"
    extensions:
      prisma: ../prisma/prisma.yml
      prepare-binding:
        output: src/generated/prisma.ts
        generator: prisma-ts

and this prisma.yml

endpoint: ${env:PRISMA_ENDPOINT}
secret: ${env:PRISMA_SECRET}
datamodel:
  - types.graphqls
hooks:
  post-deploy:
    - graphql get-schema --project prisma
    - graphql prepare

Run prisma deploy. The error for graphql get-schema is swallowed, and graphql prepare is executed.

Note, when running graphql get-schema manually, an error is returned:

→ graphql get-schema --project prisma
✖ Unsupported schema file extention. Only ".graphql" and ".json" are supported

Also note Urigo/graphql-cli#286 which might be related to the continuation of execution.

Expected behavior?

  • Errors from post deployment hooks are displayed OR introduce --verbose flag for prisma deploy to do so. I prefer the former.
  • Execution should stop if a command returns an error code.
@marktani
Copy link
Contributor Author

marktani commented Jun 1, 2018

As discussed in #2560, it seems that a missing graphql binary is also not detected.

@divyenduz
Copy link
Contributor

divyenduz commented Jun 2, 2018

Addressed by #2562 and Urigo/graphql-cli#313

@divyenduz
Copy link
Contributor

🎉This is released in prisma cli version 1.9. 🎉

Please download using npm install -g prisma

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants