mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-02-06 07:49:24 +03:00
Types are now serializable to JSON (output their name)
This commit is contained in:
parent
04550f805f
commit
7340e30753
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user