-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Relay should not attempt to diff plural fields with two-or-more linkedIDs when those IDs are client IDs #1243
Comments
Thanks for your question! I think have an answer for you, but let's take this to Stack Overflow before we continue. We want to make sure to keep signal strong in the GitHub issue tracker – to make sure that it remains the best place to track issues that affect the development of Relay. Questions like yours deserve a purpose-built Q&A forum. Would you like to post this question to Stack Overflow with the tag #relayjs? We'll be happy to answer there. Post a link to your Stack Overflow question here, to so that we don't lose track of it. |
@steveluscher yes, sure. I've crossposted it on SO. Here it is https://stackoverflow.com/questions/38059070/recursive-fetching-of-a-connection-is-rejected-by-relay-possibly-another-reason |
This is actually a bug in Relay. When we diff the query with the data in the store, we only use the first item in a plural field (the assumption being that all others will be the same). I'll send a fix shortly after lunch. |
Awesome job debugging, @steveluscher! |
Fixed in 28a8008. |
@steveluscher can you, please, look at my comment here http://stackoverflow.com/questions/38059070/recursive-fetching-of-a-connection-is-rejected-by-relay-possibly-another-reason/38065217#comment63570782_38065217 ? |
Hi @GrigoryPtashko. I saw your comment on SO, but your question is probably about to be closed as a duplicate. Feel free to open a separate question if you're still having trouble. In answer to your comment: it looks to me like the diff bug is fixed, and now you have an undefined |
Hello.
Two days of experiments and no result. Please, any advice.
Relay is up-to-date - 0.9.1.
Long story short. I'm making a recursive classifier. The next level
opens on mouse over.
The problem is that the child categories stay null in Relay but
my grapql actually answers with edges.
I'm going to give the complete code here.
I've noticed one thing that I think is the reason but I don't know how to fix it.
Here's the schema
Here's the component which must render a category and fetch dependent categories on mouse over. It is pretty much a general recursive component I suppose.
And now here's what happens. During the first render of the Classifer Relay issues the query:
I see the root category. Everything is OK. Then I hover over the category item and Relay makes another query to fetch the connection -
categories
. Here's the queryAnd here's a part of the response:
And here's the problem. After I make
this.props.relay.setVariables({ expanded: true })
there is no propertycategories
in thethis.props.category
! But I think it must be there! The backend server returns data since you can see the query is issued and it is correct.One thing that I don't understand is why there is this alias
_categories2slDfj:categories(first:10000)
?Maybe this is the reason?
Please, any advice.. I'm so close to production. This is the only thing that's holding me.
Thank you.
PS I made a gist with Classifier.js. Here it is https://gist.github.com/GrigoryPtashko/9689476a61058dc844ade11f9b81298a
The text was updated successfully, but these errors were encountered: