Create contracts Type to use in all Graph type
FabrizioCafolla opened this issue · comments
I thought that to add types (Timestamp, PaginationMeta, Links etc ..) in a simple and intuitive way was to create a class that has a static method for each type and that calls it by passing the value of the query in the "resolve" so that can be processed independently. This allows me to call these methods staunchly and makes it easy to use them in multiple types.
What do you think?
UserType.php with TimestampType for data
query=query+FetchUsers{users{id,name,timestamp{created_at,updated_at}}}
TypeRegistry all method that return Contracts type with resolve()
function
TimestampType is type of time, you can add field to fields array