Farid
Farid

Reputation: 1665

How to connect Apollo client with Apollo server

I'm following the Apollo tutorial at https://www.apollographql.com/docs/tutorial/client/. My server is running successfully on localhost:4000, and my client is running on localhost:3000. Client compiled successfully, yet I'm getting a 400 error in the browser, and it's pointing to an Apollo error:

Uncaught (in promise) Error: Network error: Response not successful: Received status code 400 at new ApolloError (bundle.esm.js:76).

The tutorial uses TypeScript for the client, which I didn't have installed, so I installed that globally, but I have not made any other changes to the client beyond what the tutorial has mentioned. Not sure if that's the issue.

For reference, the tutorial's repo is at https://github.com/apollographql/fullstack-tutorial.

Upvotes: 0

Views: 224

Answers (1)

Farid
Farid

Reputation: 1665

Solved: turns out I accidentally deleted a schema type's field, which was causing the 400. There was also a compilation error from following this tutorial (a named import in another file was throwing an error), but I resolved that by making it a default import.

Upvotes: 1

Related Questions