graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

"dotnet graphql update" delets schema file before checking if server is reachable

Open MaxFromDoqpal opened this issue 3 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

When you run "dotnet graphql update" as documented in the strawberryshake tooling.md and the endpoint is not reachable, you wil get a HTTP Error and the process stops (so far so good) BUT the process will delete the schema.graphql file before it tries to reach the server, so that you will be left with a missing schema and failing builds.

Maybe you can restore the schema from your local git client, but this can be quite annoying and dangerous.

Steps to reproduce

  1. Make sure the graphql endpoint / server is not reachable
  2. In the console navigate to the project where you have implemented StrawberryShake
  3. run "dotnet graphql update"
  4. Try to recompile or run any test - it will fail due to the missing schema file

Relevant log output

No response

Additional Context?

It would be handyto check if the server was reachable before deleting any schema files.

Product

Strawberry Shake

Version

12.12.1

MaxFromDoqpal avatar Jul 28 '22 10:07 MaxFromDoqpal

Thank you for reporting this

michaelstaib avatar Jul 28 '22 15:07 michaelstaib

This is fixed with version 13

michaelstaib avatar Feb 07 '23 06:02 michaelstaib