-
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
[writeRelayUpdatePayload] Show different error depending on whether a required field was subtracted out or simply not returned by the server #231
Comments
I found the cause of this (#232), but the problem in my first comment still stands. |
The problem is that the mutation doesn’t include the fragments for
When the |
Just to take this out of the abstract a bit, I've made a gist with the actual mutation, where I'm calling it from, the resulting query + variables, and the returned payload: https://gist.github.com/sgwilym/77191368cf1885a289e2 |
Thanks to the help of @devknoll, I found out this issue is because nowhere else in the app is |
@sgwilym Good point - the error could be more informative and check whether the field was in the query (which means its a server error to not include in the response) or if it isn't in the query (which means it was subtracted and the message could tell you the field isn't being queried anywhere). |
I spent quite a while debugging the same thing, too. It was the same issue that @sgwilym was having; i.e., the app wasn't querying the relevant fields. A more helpful warning message might be useful here. |
I'm running into this issue as well. In my case, I'm trying to use the returned data in the mutation's Is there a (good) way to force the fields to be put in the query, even if they're not used? I could do something silly like add a dummy |
I wrote about how to use the See also #237. |
The task. Given a
|
@steveluscher Awesome! Looks like #237 also addresses the fact that |
merging into #542 |
I've got a mutation that creates a new Leaf in a schema kind of like this:
The fat query in my mutation looks like this:
and the configs look like this:
Executing this query throws a warning in the console:
The mutation query received by the server doesn’t have the
trunk { id }
ornewTrunkLeafEdge
fields, so the GraphQL server doesn’t return them. I know Relay intersects the mutation query with a 'tracked query' — maybe something is going wrong there?The text was updated successfully, but these errors were encountered: