I am working with graphql and using apollo for implementing it . Everything was fine till apollo-client . but then I came in a question like if I want a user Authentication then I cant have a whole valitation and authenticating method inside a single resolve method. I came to apollo-server and then it got worse. My question
What is subscription in graphql?
Why we need this?
WIll subscription solve my problem of the login system ?
if not! how will I solve it?
Pankaj Patel
Blog, Tech, Photography etc.
Subscriptions in GraphQL are the special requests where you ask the server once about the changes in specific Data related to the query and the server will keep polling the client with changes.
We need subscriptions in case of systems like comments or chat and it is not for Login Systems
I do not get it, why are you validating on Login/Authentication system. You don't need to.
Whatever the form fields are, do a regular sanity check on the fields on the client side and send to the server; the server will figure out whether to let the user in or not.