DevOps Articles

Curated articles, resources, tips and trends from the DevOps World.

How to Execute a Simple GraphQL Query

2 years ago thenewstack.io
How to Execute a Simple GraphQL Query

Summary: This is a summary of an article originally published by The New Stack. Read the full original article here →

GraphQL is a query language that allows for highly customizable queries against Application Programmer Interfaces (APIs). https://graphql.org/ is a query language and will work with environments other than the Node/ Express environment but this tutorial works with Node/ Express.

The first GraphQLObject is the PeopleType: The people type object will outline what fields the user can query for from the API and what data types the query can expect to receive.

The inside structure will look like this: name: ‘String’, fields: { type: type of data expected from the query, function requesting queried data

So the data type to query for is an array of people objects so in the type, it’s going to be a new GraphQLList(PeopleType).

Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com