GraphQL in Action (Manning)

Author: Samer Buna
Publisher: Manning
Pages: 384
ISBN: 978-1617295683
Print: 161729568X
Audience: Developers interested in GraphQL
Rating: 4.5
Reviewer: Kay Ewbank

GraphQL has achieved impressive popularity as an open-source language for APIs that can be used for querying and manipulating data.  This book provides a practical introduction to GraphQL and its use.

GraphQL was created by Facebook for internal use in delivering their mobile application data, but since being open sourced in 2015 has become increasingly widely used. Trying to understand just what it does and how to use it hasn't been that easy, and in this book Samer Buna sets out to answer those questions.

 

Banner

The book begins with a thorough explanation of GraphQL, beginning with a clear explanation of what it is and why you might want to use it. A chapter exploring the GraphAPIs, the GraphiQL editor, and the basics of the GraphQL language is followed by a chapter on customizing and organizing GraphQL operations.

graphql

Part Two of the book covers building GraphQL APIs, starting from designing a GraphQL schema. The chapter works through creating a real API from scratch, including writing queries to interrogate the schema and designing mutations - GraphQL data modification queries. Next, Buna goes on to implementing schema resolvers, showing how to build a schema using constructor objects using JavaScript objects instantiated from calls to constructor classes. This chapter also shows how to generate SDL (schema definition language) text from object-based schemas.

A chapter on working with database models and relations looks in depth at resolving fields from databases and transforming their names and values. This is followed by an examination of optimizing data fetching that covers caching and batching, the data loader and working with circular dependencies. This part of the book ends with a chapter on implementing mutations, GraphQL queries that modify data.

The final part of the book covers using GraphQL APIs, beginning with an extensive chapter on using GraphQL APIs without a client library. This chapter covers making Ajax requests, query requests and mutation requests as well as performing query requests scoped for a user.

The final chapter looks at using GraphQL APIs with the Apollo client. Apollo is the most popular client for GraphQL that supports multiple view libraries. The chapter covers using the Apollo client with JavaScript and with React, along with implementing and using GraphQL subscriptions. The Apollo platform is an implementation of GraphQL that transfers data between the cloud (the server) to the UI of your app. When you use Apollo Client, all of the logic for retrieving data, tracking, loading, and updating the UI is encapsulated by the useQuery hook

This book provides a clear, no-hype look at what GraphQL is and how to use it. The examples are clear and well explained, and the task of creating an API and using it used throughout the book works well and ought to be modifiable for real use.

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Embedded Vision: An Introduction (Mercury Learning)

Author: S. R. Vijayalakshmi and S. Muruganand
Publisher: Mercury Learning
Date: October 2019
Pages: 580
ISBN: 978-1683924579
Print: 1683924576
Kindle: B07YN6JC19
Audience: Developers interested in vision-enabled devices
Rating: 3
Reviewer: Harry Fairhead
The power of small machines is now well able to ta [ ... ]



Understanding Software Dynamics (Addison-Wesley)

Author: Richard L. Sites
Publisher: Addison-Wesley
Pages: 464
ISBN: 978-0137589739
Print: 0137589735
Kindle: B09H5JB5HC
Audience: Every developers
Rating: 5
Reviewer: Kay Ewbank

This book looks at the different reasons why software runs too slowly, and what developers can do about it, starting by looki [ ... ]


More Reviews

 

 

Last Updated ( Wednesday, 12 May 2021 )