In this chapter, we understood the semantics of APIs. An API can over-fetch or under-fetch results for clients. This can cause additional noise in the data. Bandwidth wastage can be a big issue too. To overcome this problem, GraphQL offers a flexible approach for requesting data from APIs. This allows developers to write pragmatic APIs that do exactly what is requested by the client.
Then, we explored GraphQL in depth by understanding queries, mutations, schema, and types. We introduced many examples and saw what a GraphQL server response looks like.
Finally, we implemented a Go client for the Github API using a package called machinebox/graphql. After that, we created a server that responds to a client query.
In the next chapter, we will discuss scaling APIs using microservices.