GraphQL queries
Fetch everything the platform knows about one user, in a single request.
Your goal
Get all kinds of data about one UserPoint - profile, activities, segments, identifiers - with a single request, fast enough for real-time use.
Expected outcome
A query returning exactly the fields your use case needs, within the endpoint's documented limits.
What the GraphQL API is for
The GraphQL API gives you the ability to query all kinds of UserPoint data as collected by the platform, with a single request.
The schema used by the GraphQL endpoint is based on your schema. To add or remove fields from the GraphQL API, update the schema.
The endpoint
POST /v1/datamarts/:datamartId/query_executions/graphqldatamartId
The datamart in which the UserPoint is looked up.
The body carries a query parameter containing your GraphQL query, starting with query MyQuery {. Escape double quotes where needed.
A 200 returns { "data": { ...GraphQL response... } }. A 429 means you have exceeded the rate limit.
Limits
That last limit is the one that produces wrong conclusions rather than errors - see the @filter warning below.
Selecting the UserPoint
Any identifier works, through a different function.
Both the compartment ID and the account ID are mandatory.
The identifier types are described in User identifiers.
A fuller query
Filtering
@filter selects only the elements matching a clause. The clause is a WHERE object tree expression, so anything valid there is valid here.
Tools
Use a dedicated editor to write and test GraphQL queries. A GraphQL playground is available in Computing Console.
Related pages
Last updated
Was this helpful?