Debugging with Postman
Some time ago, Postman started as a Chrome app, which was installed through the Chrome Web Store.
Since Chrome apps will be deprecated, the guys behind Postman switched to a native implementation.
You can install Postman by downloading the appropriate file from the download section at, https://www.getpostman.com/apps.
When you have finished the installation, it should look something like this:
As you can see, I have already created a collection called Book in the left-hand panel. This collection includes our two requests: one to request all posts and one to add a new post.
As an example, the following screenshot shows you how the Add Post mutation looks in Postman:
The request body looks pretty much like what we saw before.
Be sure to select application/json as Content-Type next to the raw format.
The URL is localhost, including port 8000 as expected.
If you add a new request, you can use the Ctrl + S shortcut to save it. You need to select a collection and a name to save it. One major downfall of using Postman (at least with GraphQL APIs) is that we are, of course, only using POST. It would be great to have some kind of indication of what we are doing here, for example, a query or a mutation. We will also see how to use authorization in Postman when we have implemented it.
Postman also has other great features, such as automated testing, monitoring, and mocking a fake server.
In later chapters, it will become more complicated to configure Postman for all requests. In such cases, I like to use Apollo Client Developer Tools, which perfectly integrate into the front end and make use of Chrome DevTools. What's great about Apollo Client Developer Tools is that they use Apollo Client we configure in the front end code and therefore reuse the authentication we built into our front end.