PHP Класс GraphQL\Error\Error

Наследование: extends Exception, implements JsonSerializable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
__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

Описание методов

__construct() публичный метод

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() публичный статический метод

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
Результат Error

formatError() публичный статический метод

public static formatError ( Error $error ) : array
$error Error
Результат array

getLocations() публичный метод

public getLocations ( ) : SourceLocation[]
Результат GraphQL\Language\SourceLocation[]

getPositions() публичный метод

public getPositions ( ) : array
Результат array

getSource() публичный метод

public getSource ( ) : Source | null
Результат GraphQL\Language\Source | null

jsonSerialize() публичный метод

Specify data which should be serialized to JSON
С версии: 5.4.0
public jsonSerialize ( ) : mixed
Результат mixed data which can be serialized by json_encode, which is a value of any type other than a resource.

toSerializableArray() публичный метод

Returns array representation of error suitable for serialization
public toSerializableArray ( ) : array
Результат array

Описание свойств

$message публичное свойство

A message describing the Error for debugging purposes.
public string $message
Результат string

$nodes публичное свойство

An array of GraphQL AST Nodes corresponding to this error.
public array $nodes
Результат array

$path публичное свойство

An array describing the JSON-path into the execution response which corresponds to this error. Only included for errors during execution.
public array $path
Результат array