New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a date type example? #27
Comments
Any news on this? |
would also like to know |
Here's an example from howtographql: https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/types/date_time_type.rb |
Inspired from above. Types::DateType = GraphQL::ScalarType.define do
name 'Date'
coerce_input ->(value, _ctx) { Time.zone.parse(value).to_date }
coerce_result ->(value, _ctx) { value.iso8601 }
end |
Usage example: |
I think we still need a |
You could use: Which would have the following result: On your client side you could have easily tailor the resulting field to serve your very needs. |
For a quickstart demo helper, it would be helpful for me to see how to define a date type and use it in a schema
The text was updated successfully, but these errors were encountered: