-
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
Non string values making it to isClientID breaking isomorphic relay implementation #848
Comments
Relay treats null records as null and doesn't attempt to traverse into them or create IDs for them. Given that, if you're seeing empty objects passed to isClientID then the problem could be in isomorphic-relay or how your app is configured. Can you share a commit preview or gist of your isomorphic-relay setup? If that's tricky, where is isClientID called with the invalid value? (Stack trace would help). |
I don't think it is how my app is configured, as other graphql responses can be both prepared and injected without difficulty, it is one type of response only (again with some null values) that ends up raising the error from Here is a stack trace:
|
"Relay treats null records as null and doesn't attempt to traverse into them or create IDs for them." Does relay also treat |
Relay treats empty objects as records, and synthesizes a client ID for them if Can you paste (or link to a gist) with the query text and payload that is failing? Which record fails? |
Here is an example of the kind of response from graphql that ends up being correlated to the |
Perhaps this is more helpful, the query + result that is passed to |
In the second gist there are multiple records that have Cc @denvned |
@josephsavona, |
Also @jeromecovington what is the GraphQL schema for |
@jeromecovington Looks like your GraphQL server at least sometimes returns an empty object |
@denvned Yeah there may be issues with how |
@denvned I am (seeing)[https://gist.github.com/jeromecovington/4a2058b5f8c18b96a9ef] the |
@jeromecovington We can query against |
Hm. Although if I issue this request in graphiql, in the response I do not get any
|
Relay automatically queries for |
Going to close this due to inactivity, as I don't think there is anything actionable remaining here. Thanks for filing the report! |
I am working on injecting prepared data via
isomorphic-relay
...see this issue for further details.However, some properties of the graphql response have a value of
null
, and they seem to be getting passed off toisClientID
as empty objects, and raisingUncaught TypeError: dataID.substring is not a function
Should JSON be sanitized before being passed onto
isClientID
, or should the function return if the argument passed to it is not a string?The text was updated successfully, but these errors were encountered: