diff --git a/src/Type/Definition/LeafType.php b/src/Type/Definition/LeafType.php index a36b592..51d6af2 100644 --- a/src/Type/Definition/LeafType.php +++ b/src/Type/Definition/LeafType.php @@ -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); } diff --git a/src/Type/Definition/ScalarType.php b/src/Type/Definition/ScalarType.php index 9b9a5a5..afdd367 100644 --- a/src/Type/Definition/ScalarType.php +++ b/src/Type/Definition/ScalarType.php @@ -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); }