javascripteverywhere / web

💻 Web code examples for JavaScript Everywhere by Adam Scott, published by O'Reilly Media
https://www.jseverywhere.io/
MIT License
75 stars 56 forks source link

signIn not working #23

Open RedHoodJT1988 opened 4 years ago

RedHoodJT1988 commented 4 years ago

I have been trying for the past three days to get the signIn mutation to work for the web client. I keep receiving an error when I try to sign in. Error:

Uncaught (in promise) Error: Network error: Response not successful: Received status code 400

I can use the signIn mutation just fine on the backend through GraphQL Playground. I have deleted my files and copied the code from the project into brand new files and I am still receiving the error. I don't know what is causing the error.

P33tr commented 4 years ago

wouldn't be those backticks could it be. check the gql is enclosed in ` not '

MarioG8 commented 3 years ago

Try my approach with schema.js...I've finished book ..nearly ...(3/4) and so far is working fine ... Best Regards :)

JungSangHyup commented 3 years ago

let's try

pages/signin.js ->

const SIGNIN_USER = gql mutation signIn($email: String!, $password: String!){ signIn(username: "", email: $email, password: $password) }

it works!