logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

GraphQL::Error - GraphQL error object

Attributes

messageoriginal_error
       If there is an original error to be preserved.

   locations
       Array-ref of "DocumentLocation" in GraphQL::Type::Librarys.

   path
       Array-ref of "StrNameValid" in GraphQL::Type::Librarys or "Int"s describing the path from the top
       operation (being either fields, or a List offset).

   extensions
       Hash-ref of "JSONable" in GraphQL::Type::Librarys providing additional information.

Description

       Class implementing GraphQL error object.

Methods

is
       Is the supplied scalar an error object?

   coerce
       If supplied scalar is an error object, return. If not, return one with it as message. If an object,
       message will be stringified version of that, it will be preserved as "original_error".

   but
       Returns a copy of the error object, but with the given properties (as with a "new" method, not
       coincidentally) overriding the existing ones.

   to_string
       Converts to string.

   to_json
       Converts to a JSON-able hash, in the format to send back as a member of the "errors" array in the
       results.

perl v5.34.0                                       2022-03-27                                GraphQL::Error(3pm)

Name

       GraphQL::Error - GraphQL error object

Synopsis

         use GraphQL::Error;
         die GraphQL::Error->new(message => 'Something is not right...');

See Also