Skip to content
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

Added null check for response 'data' field before parsing payload #1216

Merged
merged 3 commits into from Apr 19, 2019

Conversation

gshcherb
Copy link
Contributor

#1215

According to https://facebook.github.io/graphql/draft/#sec-Data
null data value is a valid value and can be present in the response.

@apollo-cla
Copy link

@gshcherb: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

if (payload.containsKey("data")) {
Map<String, Object> buffer = (Map<String, Object>) payload.get("data");
Map<String, Object> buffer = (Map<String, Object>) payload.get("data");
if (buffer!=null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Am I missing smth but the changes are identical to what was before?

Copy link
Contributor

@sav007 sav007 Feb 25, 2019

Choose a reason for hiding this comment

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

Sorry my bad you are totally right.
Could you please add some tests as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added simple passing unit test.

@sav007 sav007 merged commit 84d720a into apollographql:master Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants