Skip to content
This repository has been archived by the owner on Feb 10, 2019. It is now read-only.

Create contracts Type to use in all Graph type #398

Open
FabrizioCafolla opened this issue Oct 30, 2018 · 0 comments
Open

Create contracts Type to use in all Graph type #398

FabrizioCafolla opened this issue Oct 30, 2018 · 0 comments

Comments

@FabrizioCafolla
Copy link

FabrizioCafolla commented Oct 30, 2018

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}}}
usertype

TypeRegistry all method that return Contracts type with resolve() function
typeregistry

TimestampType is type of time, you can add field to fields array
timestamptype

schermata del 2018-10-30 10-10-00

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant