EDIT: Seeing the repercussion this post had I'll make one updated, using Prisma, new GraphQL features and will be available for whatever database y...
For further actions, you may consider blocking this person and/or reporting abuse
You should check out mongoke, it automatically generates the whole graphql api based on the mongodb database schema, it also handles authorization, relay pagination and more.
mongoke-sharingan
mind the pun
I was trying out this blog . when I was tried using npm to install the packages I got error. yarn is working fine.
apollo-server-core/dist/utils/isDirectiveDefined.js:11
return typeDef.definitions.some(definition => definition.kind === language_1.Kind.DIRECTIVE_DEFINITION &&
^
TypeError: Cannot read property 'some' of undefined
Error throwing at below lines:
const server = new ApolloServer({
typeDefs: schemas,
resolvers,
context: async ({req}) => {
if (req) {
const me = await getUser(req);
return { me, models: { userModel, postModel }}
}
},
});
Nice Job :-)
Thanks
Thanks for this really good content! I just have to ask, how would you handle logout though?
Hi, thank you too!
We have many ways to handle logout:
We could do something as Django does and saving the token in the database, then checking it and deleting it when the user wants to logout.
But, I'm more oriented to frontend development, so I would handle this on the frontend, we would store the token in the storage or something then at the time we logout we just delete the token from the storage.
There are a lot of ways of handling this actions and all are valid, you just need to find the one that fits you!
Thanks Alvaro
👍
hello, can u help me with the error? Error: Cannot find module './user'
Hi Saidy, maybe you are trying to import a module that doesn’t exists, is in another directory, or has a different name! Check it
hello. how would i get deleted data from delete mutation. can you help?
tried findOneAndDelete() and it returns null;