Replies: 3 comments
-
Also tests can give some idea;
https://github.com/Urigo/graphql-scalars/blob/master/tests/iso-date/Duration.test.ts
Thanks for your comments. We'd love to accept PRs and any more contributions to make this library better for everyone in the open source community. |
Beta Was this translation helpful? Give feedback.
-
This reinforces my point. I clearly had already read the documentation on DateTime and Duration. Regarding the Duration type, I've been able to decipher the documentation, and I'm left wondering why a simple example is lacking. I will consider adding a few PRs once I become more familiar with GraphQL and scalar definitions. It would be nice to see a Moment scalar which preserves the original time zone. |
Beta Was this translation helpful? Give feedback.
-
@b2k thanks for the feedback, we would love to see PRs for the docs and iterate together with you on them! |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
The API Documentation lacks use-case examples for each of the Scalar Types.
For example, the DateTime scalar states that values are shifted to UTC. I'm assuming this means that a round-trip of a DateTime value would lose the original timezone offset. The implications of this shift is unclear in the documentation.
A scalar type that merely references an RFC also lacks clarity, such as the Currency data type. If I wanted to send 10 US Dollars as a currency scalar, what do I send? Do I send a float, an int or a string? For a string value, is it "$10.00" or "USD 10.0" or "USD10"?
Another issue is with the Duration type. What the heck is "P1W1DT13H23M34S"? I see there is a reference to an ISO standard, but no link. A link would be helpful, but an example that clarifies this would be better.
There are three Json types, Json, JsonObject and JsonLiteral, but which to use when isn't clear.
Describe the solution you'd like
Please add better descriptions that do not require visiting the ISO standards to gain a basic understanding of the Scalars. Also add use cases, showing example values of each type.
Beta Was this translation helpful? Give feedback.
All reactions