Book Image

Jumpstart Jamstack Development

By : Christopher Pecoraro, Vincenzo Gambino
Book Image

Jumpstart Jamstack Development

By: Christopher Pecoraro, Vincenzo Gambino

Overview of this book

Jamstack (JavaScript, API, and Markup) enables web developers to create and publish modern and maintainable websites and web apps focused on speed, security, and accessibility by using tools such as Gatsby, Sanity, and Netlify. Developers working with Jamstack will be able to put their knowledge to good use with this practical guide to static site generation and content management. This Jamstack book takes a hands-on approach to implementation and related methodologies that will have you up and running with modern web development in no time. Complete with step-by-step explanations of essential concepts, practical examples, and self-assessment questions, you'll begin by building an event and venue schema structure, and then expand the functionality, exploring all that the Jamstack has to offer. You’ll learn how an example Jamstack is built, build structured content using Sanity to create a schema, use GraphQL to expose the content, and employ Gatsby to build an event website using page and template components and Tailwind CSS Framework. Lastly, you’ll deploy the website to both, a Netlify server and the Microsoft Static Web Apps Service, and interact with it using Amazon Alexa. By the end of this book, you'll have gained the knowledge and skills you need to install, configure, build, extend, and deploy a simple events website using Jamstack.
Table of Contents (17 chapters)

Chapter 6: Sanity's GraphQL Playground

This chapter introduces GraphQL, a powerful query language. Sanity's GraphQL API enables external programs to interact with its structured content while following the standard that it provides. This allows developers to leverage the rich GraphQL ecosystem of tools and practices that are available in the development community. Both GraphQL and GROQ, which is Sanity's proprietary query language, are open source and can be used to interact with Sanity. However, while GROQ is specific to Sanity, GraphQL is universally used by many applications.

In this chapter, we will explain what GraphQL is, examine some of the basic queries and their format, introduce Sanity's GraphQL Playground, and learn how to use it to create and test GraphQL queries. In this chapter, we will cover the following topics:

  • An introduction to GraphQL
  • GROQ versus GraphQL
  • Sanity.io's GraphQL playground basics