The purpose of this section is to orient you to GraphQL, a "query language" for New Relic's API. Naturally, this section is very "New Relic focused." There are links provided at that bottom of this page for more general GraphQL information.
GraphQL has some key differences when compared to REST. For example, it's the client, not the server, that determines what data will be returned. Also, it becomes easy to collect data from multiple sources. In the case of New Relic, we'll see you can get account information, data about infrastructure, and issue a NRQL request, all in one GraphQL query.
Before you use the NerdGraph API Explorer in the following exercises, create a new user key.
The exercises in this section that will give you some hands on experience using "GraphiQL" a web based tool that will issue queries to New Relic's GraphQL service. These are designed to be walked through in order, as the concepts in the lessons build on each other. Start now with Schema Introspection and work your way through to being able to issue a GraphQL query that pulls data from multiple sources, including NRQL!
- Exercise 0 - Your first query
- Exercise 1 - Learning about Schemas
- Exercise 2 - Retrieving Infrastructure Information
- Exercise 3 - Using Mutations to Update Data
- Exercise 4 - Using NRQL with GraphQL
This lab touched only the surface of what's possible with GraphQL. If you would like to continue learning about GraphQL, there are some excellent resources available on the web. Here are a few for you to check out.
- New Relic GraphQL Overview
- New Relic GraphQL Tutorial
- Understanding GraphQL (finally)
- So what's this GraphQL thing I keep hearing about?
- Introduction to GraphQL
- The Fullstack Tutorial for GraphQL
- GitHub's GraphQL Explorer
Note: Some of these can be very opinionated regarding REST vs. GraphQL. From our perspective, both REST and GraphQL are, and will remain important technologies and tools in our portfolio.