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

Chapter "Authentication-State" (web-master) - Logging In does not work ! #25

Open MarioG8 opened 3 years ago

MarioG8 commented 3 years ago

Console: Uncaught (in promise) Error: Network error: Response not successful: Received status code 400
ApolloError ApolloError.js:26 error QueryManager.js:138 notifySubscription Observable.js:140 onNotify Observable.js:179 error Observable.js:240 error observables.js:12 error observables.js:12 notifySubscription Observable.js:140 onNotify Observable.js:179 error Observable.js:240 notifySubscription Observable.js:140 onNotify Observable.js:179 error Observable.js:240 createHttpLink createHttpLink.js:93

Files from project still don't solve the problem. Best Regards and Have a nice Coding! :)

MarioG8 commented 3 years ago

I think I have found the solution of this issue...! :-) I had to take it back a bit to /api/schema.js I deleted the !"username"! from type Mutation - signIn
This seemed logical because we do not have such a field in signin.js file in web/solutions/04-Authentication-State/pages/signin.js / GraphQL requires you to be explicit about specifying which fields you would like returned from your query. Am I right? Now everything works great so far ...I can log in and log out and application does not break :) I wanted to make a "pull request" but I'm ashamed ... Please analyse my code and grant permission for a "pull request" if everything works fine...?!? See You Soon and Have a nice Day or Night whatever you want;)