Replies: 1 comment
-
|
The default scalar Date/Time implementation handles empty/zero time as null which is useful in most cases |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
While working with GraphQL queries in gqlgen,I have observed the following behavior for Datetime fields:
In Go, a *time.Time field can have a zero value (0001-01-01 00:00:00 UTC).
when gqlgen marshals the field for GraphQL clients (e.g., Apollo), the field is returned as null.
This is due to gqlgen’s default MarshalTime function for the graphql.Time scalar
gqlgen/graphql/time.go
Line 11 in 9da91b3
Questions:
Should I create a custom scalar?
Beta Was this translation helpful? Give feedback.
All reactions