From the course: Programming Foundations: APIs and Web Services

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

The structure of GraphQL queries

The structure of GraphQL queries

From the course: Programming Foundations: APIs and Web Services

Start my 1-month free trial

The structure of GraphQL queries

- Graph QL lets the client specify exactly what data it needs and it makes it easier to aggregate data from multiple sources. In GraphQL a Query Document is the string you send to the server to process and request data. Query Documents are read only operations so you can't create or manipulate data with it. The query tells the server what it needs to do. The fields are what the server uses to identify what data to return. You can send your GraphQL requests as JSON but the most common format is Raw GraphQL queries. Let's take a look at that. GraphQL uses a type system to describe data and is organized around three main building blocks. The schema, queries, and resolvers. The schema defines a set of types. Queries allow you to get information about specific fields from objects. And resolvers are responsible for getting the data for us. Essentially, resolvers provide the instructions for turning a GraphQL operation into data.…

Contents