Clean up and changing user state to verified - ApolloServer

Опубликовано: 21 Октябрь 2024
на канале: Uthpala Heenatigala
766
17

We quickly clean up our apollo server.

1. First we move our queries to a separate file called Query.js
2. Do the same for the mutations as well

Now we have much cleaner simple index file

Next we get the id from the verified token and then get the user of that id and add a field to it - emailVerified and mark it as true

Finally we update the User mongoose model and the graphql.schema accordingly


Become a patron -   / doingiteasychannel  
Follow me on Twitter   / uthpala_419  


#ApolloServer