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


Foundational Python For Data Science

Author: Kennedy Behrman
Publisher: Pearson
Pages:256
ISBN: 978-0136624356
Print: 0136624359
Kindle: B095Y6G2QV
Audience: Data scientists
Rating: 4.5
Reviewer: Kay Ewbank

This book sets out to be a simple introduction to Python, specifically how to use it to work with data.



WordPress Plugin Development, 2nd Ed

Author: Brad Williams, Justin Tadlock, John James Jacoby
Publisher: Wrox
Pages: 480
ISBN: 978-1119666943
Print: 1119666945
Kindle: B0899MW9CP
Audience: WordPress developers
Rating: 4.5
Reviewer: Kay Ewbank

The authors of this book are well-known in the WordPress world, with more than 100 published plug [ ... ]


More Reviews

 

 

Last Updated ( Wednesday, 12 May 2021 )