PHP Class GraphQL\Error\Error

Inheritance: extends Exception, implements JsonSerializable
Afficher le fichier Open project: webonyx/graphql-php Class Usage Examples

Méthodes publiques

Свойство Type Description
$message string A message describing the Error for debugging purposes.
$nodes array An array of GraphQL AST Nodes corresponding to this error.
$path array An array describing the JSON-path into the execution response which corresponds to this error. Only included for errors during execution.

Méthodes publiques

Méthode Description
__construct ( string $message, array | null $nodes = null, Source $source = null, array | null $positions = null, array | null $path = null, Exception $previous = null )
createLocatedError ( $error, array | null $nodes = null, array | null $path = null ) : Error Given an arbitrary Error, presumably thrown while attempting to execute a GraphQL operation, produce a new GraphQLError aware of the location in the document responsible for the original Error.
formatError ( Error $error ) : array
getLocations ( ) : SourceLocation[]
getPositions ( ) : array
getSource ( ) : Source | null
jsonSerialize ( ) : mixed Specify data which should be serialized to JSON
toSerializableArray ( ) : array Returns array representation of error suitable for serialization

Method Details

__construct() public méthode

public __construct ( string $message, array | null $nodes = null, Source $source = null, array | null $positions = null, array | null $path = null, Exception $previous = null )
$message string
$nodes array | null
$source GraphQL\Language\Source
$positions array | null
$path array | null
$previous Exception

createLocatedError() public static méthode

Given an arbitrary Error, presumably thrown while attempting to execute a GraphQL operation, produce a new GraphQLError aware of the location in the document responsible for the original Error.
public static createLocatedError ( $error, array | null $nodes = null, array | null $path = null ) : Error
$error
$nodes array | null
$path array | null
Résultat Error

formatError() public static méthode

public static formatError ( Error $error ) : array
$error Error
Résultat array

getLocations() public méthode

public getLocations ( ) : SourceLocation[]
Résultat GraphQL\Language\SourceLocation[]

getPositions() public méthode

public getPositions ( ) : array
Résultat array

getSource() public méthode

public getSource ( ) : Source | null
Résultat GraphQL\Language\Source | null

jsonSerialize() public méthode

Specify data which should be serialized to JSON
public jsonSerialize ( ) : mixed
Résultat mixed data which can be serialized by json_encode, which is a value of any type other than a resource.

toSerializableArray() public méthode

Returns array representation of error suitable for serialization
public toSerializableArray ( ) : array
Résultat array

Property Details

$message public_oe property

A message describing the Error for debugging purposes.
public string $message
Résultat string

$nodes public_oe property

An array of GraphQL AST Nodes corresponding to this error.
public array $nodes
Résultat array

$path public_oe property

An array describing the JSON-path into the execution response which corresponds to this error. Only included for errors during execution.
public array $path
Résultat array