You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The gatsby-transformer-yaml plugin has a great behavior for parsing date strings and exposing them as rich Dates with the ability to format them through GraphQL query parameters! The ability to write simple, human-readable date strings like 2018-01-01 in YAML and have a rich date to query against for things like days of the week, abbreviations, etc., is excellent.
I was disappointed to discover that this feature is limited to scalars. Creating a list of date strings exposes no ability to format all of them through the query.
My workaround is to add another object layer, e.g. a list of objects that have a single property called date, but it would be nice to not have to do that.
When a scalar is a date it works but when we create a list (scroll up a bit), we correctly infer that the items within the list are a date but we're not add the date arguments to the list.
Do you feel up to doing a PR to add support for this? We'd need to abstract out the arguments and resolve function for the date field so it works for both scalar and list values.
Description
The
gatsby-transformer-yaml
plugin has a great behavior for parsing date strings and exposing them as rich Dates with the ability to format them through GraphQL query parameters! The ability to write simple, human-readable date strings like2018-01-01
in YAML and have a rich date to query against for things like days of the week, abbreviations, etc., is excellent.I was disappointed to discover that this feature is limited to scalars. Creating a list of date strings exposes no ability to format all of them through the query.
My workaround is to add another object layer, e.g. a list of objects that have a single property called date, but it would be nice to not have to do that.
Environment
Gatsby version: 1.9.151
Node.js version: 8.9
Operating System: macOS Siera 10.12.6
Example
Data
Query
Desired result
Current result
The text was updated successfully, but these errors were encountered: