nodesource / ncm-cli

Command-line tool for NodeSource Certified Modules 2.0
Other
19 stars 13 forks source link

Read and report errors from graphql HTTP requests #171

Closed Raynos closed 2 years ago

Raynos commented 5 years ago

GraphQL will return { data, errors } and we are currently ignoring errors.

GraphQL will always return 200 with { data, errors } instead of 200 data or 500 errors.

GraphQL only returns a 400 if you send it invalid syntax in the HTTP POST body.

juliangruber commented 5 years ago

https://github.com/prisma/graphql-request/blob/master/src/index.ts#L31-L45

Raynos commented 5 years ago

The DB might not be corrupted https://github.com/nodesource/ncm2-api/issues/253

We are getting nulls back because thats how graphql works when it has an error in a sub document. We are just not reporting errors in the CLI.

We can add error reporting and look at the corrupted module that was broken and see what the error was.