diff --git a/src/Type/Definition/Type.php b/src/Type/Definition/Type.php index 02908b0..04a0e69 100644 --- a/src/Type/Definition/Type.php +++ b/src/Type/Definition/Type.php @@ -16,7 +16,7 @@ GraphQLInputObjectType | GraphQLList | GraphQLNonNull; */ -abstract class Type +abstract class Type implements \JsonSerializable { const STRING = 'String'; const INT = 'Int'; @@ -250,6 +250,14 @@ abstract class Type return $this->name; } + /** + * @return string + */ + public function jsonSerialize() + { + return $this->toString(); + } + /** * @return string */