academind / yt-graphql-react-event-booking-api

Code for GraphQL + React Event Booking API Series: https://academind.com/learn/node-js/graphql-with-node-react-full-app/
395 stars 302 forks source link

Cannot read property '_doc' of null #5

Open azaz0 opened 5 years ago

azaz0 commented 5 years ago

Hello I have some issue with taking user._doc. I used the same code. I check it line by line - letter by letter. It shows when i am trying to use query: query { events { _id title description date price creator { _id email } } } or trying to get creator id on frontend - there code is also the same. my package.json file: `{ "name": "graphql-react-ev-booking", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "nodemon app.js" }, "author": "", "license": "ISC", "dependencies": { "bcryptjs": "^2.4.3", "body-parser": "^1.18.3", "express": "^4.16.4", "express-graphql": "^0.7.1", "graphql": "^14.1.1", "jsonwebtoken": "^8.5.0", "mongoose": "^5.4.15" }, "devDependencies": { "nodemon": "^1.18.10" }

I was tried to fix it by myself for two days i will still try. I appreciate if You look at it.

Thanks.

SwyserDev commented 5 years ago

Hey azaz,

Could you please post some more information. Which file are you working in? Perhaps post a screenshot of the error you are getting?

Regards Francois

Th3Botanist commented 5 years ago

Hey mate,

If you haven't resolved it yet, try checking your database for previous bookings where the event is null and delete them.

Hope that works!

B

azaz0 commented 5 years ago

Hey, you made my life. It works now. I spend many hours trying solve this problem. More than enough, not enough to take that thought on start and check it. Thanks Mate :]

pon., 4 mar 2019 o 00:38 Brendan notifications@github.com napisał(a):

Hey mate,

If you haven't resolved it yet, try checking your database for previous bookings where the event is null and delete them.

Hope that works!

B

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/academind/yt-graphql-react-event-booking-api/issues/5#issuecomment-469077574, or mute the thread https://github.com/notifications/unsubscribe-auth/Aja_LNFHsYQaqwGYpvnfIBirTJGTH1Sbks5vTFzjgaJpZM4bVhA6 .