Joins with link
How to create joins on items within and across content types.
Items are instances of content types. You can join items from the same or other content types within or across sources in a single Optimizely Graph query bylinking them with different connection types. This makes it possible to query your content as a graph, although still represented as a hierarchy due to the nature of GraphQL.
Before you create a link query, you should configure your content types in the schema. Seeconfiguration of links.
Use theLink method to create the link query:
var linkQuery = new LinkQueryBuilder<BiographyPage>().WithLinkType("MyCustomLinkType").Fields(x=>x.Name);var query = queryBuilder.OperationName("MyQuery").ForType<StartPage>().Fields(x=>x.Name).Total().Link(linkQuery);var rawData = await query.GetRawResultAsync();var content = //convert rawData to your contentTheLink query's response is very dynamic. You should convert the JSON response to the data objects by yourself. UseGetRawResultAsync to get raw data as a string.
Updated 22 days ago
