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).

Related Articles