Tag: exception

  • Can’t use extensions with GraphQLError

    Can’t use extensions with GraphQLError

    3 From the Apollo Graphql document, this way can define extension error: https://www.apollographql.com/docs/apollo-server/data/errors/ import { GraphQLError } from ‘graphql’; throw new GraphQLError(‘the error message’, extensions: { code: ‘SOMETHING_BAD_HAPPENED’, https: { status: 404, headers: new Map([ [‘some-header’, ‘it was bad’], [‘another-header’, ‘seriously’], ]), }, }, ); But in my case it got this error: Argument of…

  • Custom GraphQL exceptions

    Custom GraphQL exceptions

    0 I’m trying to create a custom exception when GraphQL throws its owns. The default GraphQL exception response I got is (except for the fillings): { "errors": [ { "message": "Validation error of type WrongType: argument ‘inputLocals.localId’ with value ‘IntValue{value=7777800}’ is not a valid ‘Int’ – Expected value to be in the Integer range but…