GraphQL java send custom error in json format
I am working in an graphql application where I have to send custom error object / message in json irrespective of whether it occurs in servlet or service. Expected error response { errorCode: 400 //error goes here, errorMessage: "my error mesage"} It will be helpful if someone could guide me to achieve the above requirement. felipe_gdr GraphQL specification defines a clear format for the error entry in the response. According to the spec, it should like this (assuming JSON format is used): "errors": [ { "message": "Name for character with ID 1002 could not be fetched.", "locations": [ { "line"