Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

NGQL: Handle null better in input data #3272

Merged
merged 1 commit into from
Mar 15, 2017

Conversation

arv
Copy link
Contributor

@arv arv commented Mar 15, 2017

Struct fields are not allowed to be null or missing.

Lists/Sets may not contain null.

Struct fields are not allowed to be null or missing.

Lists/Sets may not contain null.
@arv arv requested a review from kalman March 15, 2017 22:47
test(m2, `{"data":null,"errors":[{"message":"Variable \"$ks\" got invalid value [{}].\nIn element #1: In field \"n\": Expected \"String!\", found null.","locations":[{"line":1,"column":12}]}]}`,
q,
map[string]interface{}{
"ks": []interface{}{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can leave out this []interface{}, Go can figure out the type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are cases where the type name is not needed. This case is needed though.

@arv arv merged commit ba3fcfc into attic-labs:master Mar 15, 2017
@arv arv deleted the ngql-input-type-field-required branch March 15, 2017 23:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants