Introduction

What is GraphQL?

GraphQL is an API query language, originally created by Facebook as an alternative to REST. If you're new to GraphQL, the best place to start is the official documentation.

How do I make a query?

It depends on what kind of environment you are making the query from. Check out this list of GraphQL client libraries to see some tools already available in multiple languages, including C#/.NET, Go, Java, JavaScript, and Python. These client libraries can make writing queries easier and may provide built-in support for features like caching.

However, GraphQL is just a query language served over HTTP, so you can also make a request without using any GraphQL-specific libraries or packages. Here's an example using cURL:

curl 'https://app.codesignal.com/graphql' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer MY_API_KEY' --data-binary '{"query":"{ companyTest(id: \"MY_TEST_ID\") { title } }"}'

This returns data that looks like this:

{"data":{"companyTest":{"title":"My Company Test"}}}

What kinds of queries can I make?

Take a look at our schema. All read-only queries can be found under RootQuery, and all mutations can be found under RootMutation.

Authentication

How do I get an API key?

If you're not already using CodeSignal, start a conversation with us by requesting a demo.

If you're an existing customer, reach out to support@codesignal.com to learn more.

How do I make an authenticated request?

When making a GraphQL request, pass an "Authorization" header with a value of "Bearer YOUR_API_KEY" with the HTTP request. You can see a simple example of this in the cURL command above.

Some queries or mutations may require specific permissions to be assigned to your API key. If you receive Access Denied errors that you believe to be in error, please contact support.