HomeDev guideAPI ReferenceGraphQL
Dev guideUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Fields selection

Select the expected fields that are returned from the response.

πŸ‘

Beta

The Optimizely Graph .NET Client is in beta. Contact your Customer Success Manager for information.

The Field and Fields methods are used for selecting properties of data objects. You can select your expected fields for response by calling multiple Field or Fields methods, for example:

var query = queryBuilder
.ForType<MyDocument>()
  .Fields(x=>x.Property1, x=> x.Property2)
  .Field(x=>x.Property3)
.ToQuery()
.BuildQueries();

System fields

Optimizely Graph exposes the following system fields that can be selected using the following methods:

  • _deleted – GetDeleted()
  • _id – GetId()
  • _modified – GetModified
  • _score – GetScore()
var query = queryBuilder
.ForType<MyDocument>()
  .Fields(x=>x.Property1, x=> x.Property2)
  .GetScore()
  .GetId()
  .GetModified()
  .GetDeleted()
.ToQuery()
.BuildQueries();

If you are using Optimizely's generation tool, these system fields are not generated by default. You need to add them manually.