Sly777 / ran

:zap: RAN! React . GraphQL . Next.js Toolkit :zap: - SEO-Ready, Production-Ready, SSR, Hot-Reload, CSS-in-JS, Caching, CLI commands and more...
MIT License
2.22k stars 160 forks source link

Is there a backend to this? [Question] #601

Closed noobling closed 5 years ago

noobling commented 5 years ago

Hello,

I am using your app to learn more about web technologies. I don't understand how authentication is done. It seems like it would require a backend. All I have is this GraphQL code to go off

mutation signinUser($email: String!, $password: String!) {
  signinUser(email: { email: $email, password: $password }) {
    token
  }
}

Am I correct in assuming that the backend will execute the authentication code when this query is posted to the graph cool end point?

Thanks!

Sly777 commented 5 years ago

Normally It uses graphql mutation function for user login so It needs to have (with most of third-party graphql services have this). If you are using your own graphql, Please create signinUser mutation function on your server side. @noobling

noobling commented 5 years ago

So authentication is handled by Graph Cool in this case?

Sly777 commented 5 years ago

@noobling on this example, yep

noobling commented 5 years ago

Thanks!