GraphQL
Core Concepts
GraphQL is a query language for data that is available via API. It allows the developer to ask for exactly the data wanted, in the shape wanted.
Forming calls with GraphQL
You can run queries on the Optimizely Data Platform (ODP) using GraphQL API and GraphQL Explorer. The GraphQL Explorer uses the same authentication as ODP's REST APIs.
Query real-time segments
The GraphQL API allows you to view the results of existing segments. This document focuses on the public GraphQL API.
Filter Examples
You can find specific customers using the GraphQL filter function. Below are some examples.
Facet queries
You can use GraphQL to return aggregated results for dimension columns. For example, if you want to check the most frequently used name in your customers dimension, execute the following GraphQL query The response returns the aggregated results The facet query returns up to 10 aggregated results sorted in descending order based on popularity (number of occurrences) in the data set.
Query list subscriptions
To query list subscriptions for a specific customer, use the list member object to search for a specific list id . For example, if you have a newsletter list with list id = newsletter list , you can run the following query to check if a customer is subscribed to that list.