question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't swallow all errors in graphql function

See original GitHub issue

There seems to be no way to get errors out of graphql function and one only gets error title, which can be the dreaded undefined is not a function deep inside schema or resolve. Would be nice if there’d be a flag to let errors pass through from graphql function, when they are not validation errors. I’d be willing to implement it if this change makes sense.

Thanks!

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:20 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
luchillo17commented, Feb 25, 2017

Using formatError as well, is there a way to pass the same error handler when using in testing? (in tests you most of the time query directly using the graphql object to execute the query with the schema.

import {
  graphql,
} from 'graphql';
...
let resp = (await graphql(Schema, query, {}, context));
3reactions
tristanzcommented, Feb 23, 2016

This seems to be fixed here: https://github.com/graphql/express-graphql/pull/45/files

  graphiql: true,
  formatError: (error) => ({
    message: error.message,
    details: config.isProduction ? null : error.stack
  })
Read more comments on GitHub >

github_iconTop Results From Across the Web

The Definitive Guide to Handling GraphQL Errors | by Matt Krick
Remember, this works perfectly for mutations, but queries and subscriptions swallow errors unless they're thrown, which means if you want it in ...
Read more >
9 Ways To Secure your GraphQL API
Let's talk security: a significant part of every stable application ... To prevent this issue, swallow errors before they get to the client....
Read more >
GraphQL Client - Dart Package - Pub.dev
A stand-alone GraphQL client for Dart, bringing all the features from a modern GraphQL client to one easy to use package.
Read more >
How to prevent graphql error and do mutation by scalar type in ...
I haven´t play around that much with ScalarTypes, but try to add it directly to your resolvers map.
Read more >
Error observability for graphql API in AWS Lambda
Hi, We have instrumented distributed tracing using OpenTracing, new relic ingest and followed all the steps to see traces in the data ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found