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

Skip null array items in `getDataFromTree` #1355

merged 2 commits into from Nov 29, 2017


None yet
3 participants
Copy link

dan-lee commented Nov 25, 2017

I have the case that occasionally a component may return an array with a null value in it. Unfortunately this breaks the tree walker and eventually our server side rendering:

Cannot read property 'type' of undefined
at walkTree (/.../node_modules/react-apollo/react-apollo.umd.js:674:34)

From the React standpoint this should be totally fine:

So in this PR I added a null check and tests to cover this case.


This comment has been minimized.

Copy link

meteor-bot commented Nov 25, 2017

@dan-lee: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here:


This comment has been minimized.

Copy link

meteor-bot commented Nov 25, 2017



Generated by 🚫 dangerJS


This comment has been minimized.

Copy link

jbaxleyiii commented Nov 29, 2017

@dan-lee this is great! Thanks so much!

@jbaxleyiii jbaxleyiii merged commit e659ff9 into apollographql:master Nov 29, 2017

2 of 4 checks passed

Danger ⚠️ Danger found some issues. Don't worry, everything is fixable.
continuous-integration/travis-ci/pr The Travis CI build failed
CLA Author has signed the Meteor CLA.
bundlesize ./dist/index.min.js: 8.46kB < maxSize 8.6kB gzip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment