-
Notifications
You must be signed in to change notification settings - Fork 191
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
Error when clicking Edit button #12
Comments
It could be that in your database, the record has the string "2" instead of the number 2 in the _id field. Please try and clear the collection and re-initialize, and it should work, if that is the case. |
I am in Chapter 9, Nested Routes and I have also the similar error when clicking on button Select. I have tried that quick fix for that issue in IssueDetail.jsx |
What is the version of apollo-server-express you have installed? If it is not 2.3.x, it could be the reason. |
Thanks for your response, I'm using apollo-server-express v 2.13.0, but I've tried 2.3.x from Github and it produced the same error. Since Id is an integer, I think it should be sent to graphQLFetch variable with a parseInt(id). For your reference, this is the file in question |
I too have the same problem. My apollo-server-express is 2.3.1 and all my ids on mlab are definitely of the int kind. The other functions using the id seem to work like delete and restore so its quite baffling, otherwise great stuff. |
Chap 10: Edit Form - I came across the same error message. I used the same solution as above on IssueEdit.jsx to resolve the error message. New code: const data = await graphQLFetch(query, { id: parseInt(id) } ); |
Change "const data = await graphQLFetch(query, { id } );" To "const data = await graphQLFetch(query, { id: parseInt(id) });" Do this inside IssueEdit.jsx as well as IssueDetail.jsx in the async loadData() and this should fix it for you as it did for myself as noted above in reference to dtrhieu. |
When I click Edit I keep getting INTERNAL_SERVER_ERROR.
[GraphQLError: Variable "$id" got invalid value "2"; Expected type Int; Int cannot represent non-integer value: "2"]
As a result the page says 'Issue with ID 2 not found'.
In every Chapter I get this. I'm in Chapter 11 now. The code is from the web site.
The text was updated successfully, but these errors were encountered: