Dev guideRecipesAPI ReferenceChangelog
Dev guideRecipesUser GuidesNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev guide

Query

Overview of queries in Optimizely Graph.

Use Optimizely Graph queries to fetch only the fields and relationships you need in a single request, reducing payload size and improving page performance. This overview introduces the three query patterns Graph supports so you can choose the right shape for interconnected, parent-child, or hierarchical content.

In GraphQL, a query is a request for data from a server. Unlike traditional REST APIs, GraphQL lets you request the data you need with a single query. Specify which fields and relationships to retrieve to reduce the amount of data transferred over the network.

A basic GraphQL query consists of the following three query types:

  • Cyclic queries – Traverse relationships within the user data schema. Useful for exploring interconnected data structures.
  • Parent and child queries – Create a single query to retrieve parent documents and their children's data using joins with linking. Lets you nest queries to fetch related data and use arguments to filter data.
  • Recursive queries – Handle hierarchical data structures. Support navigation of nested relationships within your data.