Types are now serializable to JSON (output their name)

This commit is contained in:
vladar 2016-11-19 17:25:34 +07:00
parent 04550f805f
commit 7340e30753

View File

@ -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
*/