To facilitate better answering of questions, if you have a question, please fill in the following info. Otherwise, please delete the template.
What I want to do
When querying dgraph, through GraphQL playground, I see the following:
Query:
{“operationName”:null,“variables”:{“input”:[{“name”:“brian”}]},“query”:“mutation ($input: [AddPersonInput!]!) {\n addPerson(input: $input) {\n person {\n name\n birthName\n birthDate\n deathDate\n }\n }\n}\n”}
Response:
{“data”:{“addPerson”:{“person”:[{“name”:“brian”,“birthName”:null,“birthDate”:null,“deathDate”:null}]}}}
However when querying the same request through Go, with the same query I get the following response:
{“data”:{“addPerson”:{“person”:[{“name”:“brian”,“birthName”:"",“birthDate”:"",“deathDate”:""}]}}}
This causes issues as when unmarshalling the json into a struct, it produces an error when parsing time:
parsing time “”"" as "“2006-01-02T15:04:05Z07:00"”: cannot parse
GraphQL schema:
type Person {
name: String
birthName: String
birthDate: DateTime
deathDate: DateTime
}
I want Dgraph to respond with null instead of an empty string
What I did
I have tried mimicking the network request from Graphql playground with identical headers, however cannot seem to get Dgraph to respond with null instead of “”.
Dgraph metadata
dgraph version
Dgraph version v20.03.0 running in a docker container