Learning GraphQL: Declarative Data Fetching for Modern Web Apps by Eve Porcello & Alex Banks

Learning GraphQL: Declarative Data Fetching for Modern Web Apps by Eve Porcello & Alex Banks

Author:Eve Porcello & Alex Banks [Porcello, Eve]
Language: eng
Format: epub
Publisher: O'Reilly Media
Published: 2018-08-09T05:00:00+00:00


var photos = [ { ... "created": "3-28-1977" }, { ... "created": "1-2-1985" }, { ... "created": "2018-04-15T19:09:57.308Z" } ]

Now, when we add DateTime fields to our selection sets, we can see those dates and types formatted as ISO date strings:

query listPhotos { allPhotos { name created } }

The only thing left to do is make sure that we add a timestamp to each photo when it is posted. We do this by adding a created field to every photo and timestamping it with the current DateTime using the JavaScript Date object:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.