Optionaloptions: GraphQLErrorOptionsOptionalcauseOptional ReadonlycoordinateAn optional schema coordinate (e.g. "MyType.myField") associated with this error.
ReadonlyextensionsExtension fields to add to the formatted error.
ReadonlylocationsAn array of { line, column } locations within the source GraphQL document
which correspond to this error.
Errors during validation often contain multiple locations, for example to point out two things with the same name. Errors during execution include a single location, the field which produced the error.
Enumerable, and appears in the result of JSON.stringify().
ReadonlynodesAn array of GraphQL AST Nodes corresponding to this error.
ReadonlyoriginalThe original error thrown from a field resolver during execution.
ReadonlypathAn array describing the JSON-path into the execution response which corresponds to this error. Only included for errors during execution.
Enumerable, and appears in the result of JSON.stringify().
ReadonlypositionsAn array of character offsets within the source GraphQL document which correspond to this error.
ReadonlysourceThe source GraphQL document for the first location of this error.
Note that if this Error represents more than one node, the source may not represent nodes after the first node.
OptionalstackStaticstackThe Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Returns a string representation of an object.
StaticcaptureCreates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
OptionalconstructorOpt: FunctionStaticisIndicates whether the argument provided is a built-in Error instance or not.
Staticprepare
This error is thrown when the user input is invalid.
"UserInputError" class was removed in the latest version of Apollo Server (4.0.0) It was moved to the @nestjs/apollo package to avoid regressions & make migration easier.
Public Api