mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-02-06 07:49:24 +03:00
Moved parse/serialize methods from abstract ScalarType class to LeafType interface (as EnumType implements them as well)
This commit is contained in:
parent
e56eb6e10d
commit
8f80389ecf
@ -8,4 +8,27 @@ GraphQLEnumType;
|
||||
*/
|
||||
interface LeafType
|
||||
{
|
||||
/**
|
||||
* Serializes an internal value to include in a response.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function serialize($value);
|
||||
|
||||
/**
|
||||
* Parses an externally provided value to use as an input
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function parseValue($value);
|
||||
|
||||
/**
|
||||
* Parses an externally provided literal value to use as an input
|
||||
*
|
||||
* @param \GraphQL\Language\AST\Value $valueAST
|
||||
* @return mixed
|
||||
*/
|
||||
public function parseLiteral($valueAST);
|
||||
}
|
||||
|
@ -34,28 +34,4 @@ abstract class ScalarType extends Type implements OutputType, InputType, LeafTyp
|
||||
|
||||
Utils::invariant($this->name, 'Type must be named.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes an internal value to include in a response.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function serialize($value);
|
||||
|
||||
/**
|
||||
* Parses an externally provided value to use as an input
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function parseValue($value);
|
||||
|
||||
/**
|
||||
* Parses an externally provided literal value to use as an input
|
||||
*
|
||||
* @param \GraphQL\Language\AST\Value $valueAST
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function parseLiteral($valueAST);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user