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

star-wars example doesn't load in browser, shows "Invariant Violation" error in console #358

Closed
shanecav opened this issue Sep 20, 2015 · 8 comments
Assignees
Labels

Comments

@shanecav
Copy link

With a fresh clone of relay, then running npm install and npm start from examples/star-wars/, going to http://localhost:3000 displays the following error in the console:

Invariant Violation: RelayOSSNodeInterface: Expected payload for root field factions to be a single non-array result, instead received an array with 1 results.
_markAsRejected @ relay.js:7312

@steveluscher
Copy link
Contributor

cc/ @yungsters

@yungsters
Copy link
Contributor

I was able to reproduce the issue.

It seems like when we try to write the payload for ['empire', 'rebels'], the query we have looks like:

factions(names: 'empire') { ... }

I suspect this issue is due to diffRelayQuery splitting off the faction(names: ...) query and not correctly preserving the Array-ness of the argument.

@josephsavona josephsavona self-assigned this Sep 21, 2015
josephsavona added a commit that referenced this issue Sep 22, 2015
Summary: Addreses #358 - ensures that when `diffRelayQuery` splits plural root calls into queries per value, that the root call values are arrays of a singular values instead of scalars. This ensures that the check in `RelayOSSNodeInterface` for matching root call / payload plurality passes.
Closes #361

Reviewed By: @steveluscher

Differential Revision: D2462359
@kassens
Copy link
Member

kassens commented Sep 22, 2015

be0111d doesn't seem to fix the issue

@josephsavona
Copy link
Contributor

@kassens Are you sure you updated? I've confirmed the fix on latest.

@josephsavona
Copy link
Contributor

@shanecav thanks for reporting this issue, this is fixed on master :-)

@kassens
Copy link
Member

kassens commented Sep 22, 2015

Okay, works for me as well now. Not sure what was going on.

@shanecav
Copy link
Author

Perfect, thanks @josephsavona!

hannesj added a commit to HSLdevcom/digitransit-ui that referenced this issue Oct 7, 2015
@kevinSuttle
Copy link

This is what I'm getting.

screen shot 2016-03-25 at 12 40 58 am

screen shot 2016-03-25 at 12 34 22 am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants