0

I am trying to do a custom error format on graphql without using express-graphql. What I tried to do is:

import { graphql } from 'graphql';

graphql.formatError = err => ...;

Sadly, it doesn't work. It would be great if you guys could help me out.

1 Answer 1

1

Looking in the docs and the source code, I did'nt found anything about formatError in graphql module, only in 'express-graphql':

const express = require('express');
const graphqlHTTP = require('express-graphql');

const app = express();

app.use('/graphql', graphqlHTTP({
  schema: MyGraphQLSchema,
  graphiql: true,
  formatError: (error) => {}
}));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.