Skip to main content
All CollectionsAPI Documentation
An introduction to GraphQL
An introduction to GraphQL
Updated over a week ago

In this guide, you can learn how you can use the SuperOps.ai platform’s GraphQL API to access all sorts of data from SuperOps.ai and connect SuperOps.ai with other applications.

With these APIs, you can integrate SuperOps.ai with different applications, migrate data across tools with ease, and more.

But before we get started, let’s look at a brief summary of what GraphQL is, and what it does.

What is GraphQL?

GraphQL is an open-source query language for APIs. The GraphQL API helps you connect with applications and lets you access linked data in the form of a graph of entities. In the case of REST APIs, you either end up underfetching or overfetching to retrieve the needed entities. That’s where GraphQL comes in: GraphQL is designed to make APIs fast, usable and developer-friendly.

GraphQL is an intuitive language, and we recommend checking out an introduction to GraphQL and learning about the Core Concepts of GraphQL to learn more and get up to speed on GraphQL.

What you can do with SuperOps.ai’s GraphQL APIs

  • Connect everyday applications in your tech stack with SuperOps.ai

  • Migrate information to and from other software tools

  • Pull and modify information from other tools you use


📝 Note

Currently, the GraphQL APIs are available for the following entities in SuperOps.ai:

  • Clients

  • Requesters

  • Technicians

  • Tickets

  • Assets

  • Alerts

  • Patches

  • IT Documentation


Examples of GraphQL APIs

In this section, you’ll find some examples of how you can use GraphQL APIs to query information from an application.

A standard GraphQL POST request should use the application/json content type, and include a JSON-encoded body of the following form:

{ "query": "...", "variables": { "variable1": "value", "variable2": { "key": "value" }, ... } }

Here, ‘variables’ is an optional field, which contain the input values provided.

Queries

This sample query returns the details of a Client.

query: query example_get_client($**client**: ClientIdentifierInput!) { getClient(input: $client) { accountId name emailDomains } } variables: { "client": { "accountId": "5016054681314398208" } }

This sample query displays what occurs when no Client is present for the requested identifier.

query example_get_client($**client**: ClientIdentifierInput!) { getClient(input: $client) { accountId name emailDomains } } variables: { "client": { "accountId": "5016054681314398208" } } # returns { "data": { "getClient": null } }

Mutation

This sample mutation is used for the creation of a client.

query: mutation example_create_client($client: CreateClientInput!) { createClient(input: $client) { accountId name emailDomains } } variables: { "client": { "name": "Acme", "emailDomains": ["acme.com"] } }
Did this answer your question?