-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: Argument id for data.postedBy.connect.id must not be null. Please use undefined instead. #1217
Comments
I'm experiencing the same issue. |
I was able to get them to run by signing up and logging in. To sign up (fill in your email, password, and name):
Take that token and put it into the HTTP Headers section at the bottom like:
|
I was having the same issue, @nataliegirard solution solved it, thanks! |
Thanks @nataliegirard for the solution. |
having the same issue but in the react-apollo app |
I did what @nataliegirard said but when I put the authorization on HTTP header I got server error 500, if I delete from the HTTP header the server come back instantly but with the very same first error. any suggestions? |
I found the issue, I forget to delete the "<" and ">" from the token, now it works properly, thank you. |
install prisma package instead @prisma/cli in devDependencies manually create prisma back client manually migrate db avoid problems in tutorial: howtographql/howtographql#1217 (comment) howtographql/react-apollo#110
I'm having the same issue, and the answer of @nataliegirard worked for me. Thanks in advance! |
Thank you very much!!!! @nataliegirard |
would anyone be willing to try out a draft PR to update the docs to make it clear for learners? |
They really need to update the code because there are lots of issues with it. |
Unfortunately, this issue remains, and the fix from @nataliegirard does not have an effect |
I had the same issue when going through mutation chapter. I solved it by changing index.js like
|
Perfect. Fixed the issue when going trough https://www.howtographql.com/react-apollo/3-mutations-creating-links/. Thank you! |
helps me |
This solved my problem.Thank you |
I got the same error while doing graphQL client-side tutorial. And I think I found a problem and temporal solution from here which is experiencing server error while I'm currently writing this.
async function post(parent, args, context, info) {
const { userId } = context;
const newLink = await context.prisma.link.create({
data: {
url: args.url,
description: args.description,
postedBy: { connect: { id: userId } },
},
});
context.pubsub.publish('NEW_LINK', newLink);
return newLink;
} And update like this. async function post(parent, args, context, info) {
let { userId } = context;
if (!userId) {
userId = 3;
}
...
return newLink;
} As I said this is a temporal solution. I hope for an update asap! |
When using the answer provided by @kobeydon, remember to import the import { setContext } from '@apollo/client/link/context' |
How to get your token?
|
This is what I was missing! I had imported the function from 'react' but that didn't work. |
Is there any PR to fix that in the tutorials already? Thanks everyone, specially @kobeydon. |
People doing that tutorial section can't go forward due an error, see howtographql#1217. This adds information to continue.
People doing that tutorial section can't go forward due an error, see #1217. This adds information to continue.
@eric8979 could you please explain me why are you setting a static user id value? |
@giovannipds I have missed that information(“why 3?”) and the answer is “no particular reason, just setting arbitrary number”. Sorry about that. But I don't quite agree with
First of all, I don’t remember clearly but I think my post was for people(mostly for beginners) who just wanted their code to run first to check other things are functioning correctly. That's why I called it "temporal" solution. |
Hi!
I'm attempting to run the two GraphQL mutations specified at the end of the this article: https://www.howtographql.com/react-apollo/1-getting-started/, but after following every step in the above, I'm getting this error that Googling has turned up blank for.
Does anyone know what's going on here?
The text was updated successfully, but these errors were encountered: