HomeDev GuideRecipesAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Troubleshoot Optimizely Graph errors in C# SDK

Optimizely Graph errors, their causes, and how to resolve them.

When a request to Optimizely Graph fails, the service returns an HTTP status code and a specific error code that describes the problem. These errors usually result from authentication issues, invalid queries, or content that has not yet synchronized to the Graph index.

This reference lists common errors returned by Optimizely Graph, explains their typical causes, and shows how to resolve them. Use this information to diagnose problems in your queries and configuration.

❗️

Warning

Never include API keys or secrets when sharing error details.

HTTP errors

400 – BAD_REQUEST

Message

Bad Request – the GraphQL request is malformed.

Possible causes

  • The GraphQL query syntax is invalid.
  • A field name is misspelled.
  • The request body is not valid JSON.
  • Required query parameters are missing.

Resolution

  • Check the error response body for details about the failure.
  • Validate the query syntax for missing braces, parentheses, or quotation marks.
  • Confirm that all required parameters are included in the request.

404 – NOT_FOUND

Message

Not Found – the requested endpoint or content does not exist.

Possible causes

  • The content has not synchronized to Optimizely Graph yet.

Resolution

Run the Graph Full Synchronization scheduled job in CMS. When it completes, retry your query.

500 – INTERNAL_ERROR

Message

Internal Server Error – service issues.

Possible causes

  • Content Graph service is experiencing issues.
  • Query complexity exceeds processing limits.
  • Unexpected server-side errors occur.

Resolution

  • Simplify the query by reducing the result set or removing complex filters.
  • If the issue persists, contact Optimizely Support and include the correlation-id value from the response header.

Authentication errors

401 – GRAPH_AUTH_FAILED

Message

Authentication failed – invalid or missing API key.

Possible causes

  • AppKey or Secret is not configured in appsettings.json.
  • The configured keys are incorrect.

Resolution

Verify that appsettings.json (or environment variables) contains the correct values:

{
  "Optimizely": {
    "Graph": {
      "Endpoint": "https://cg.optimizely.com",
      "AppKey": "YOUR_APPKEY_HERE",
      "Secret": "YOUR_SECRET_KEY_HERE"
    }
  }
}

See Authentication for credential setup.

Query errors

400 – GRAPH_QUERY_INVALID

Message

Query validation failed – syntax errors in GraphQL query.

Possible causes

  • Malformed lambda expressions in .Where() clauses.
  • Invalid filter expressions or comparison operators.
  • Incorrect method chaining order.
  • Missing brackets or parentheses.

Resolution

  • Verify all brackets and parentheses are balanced.
  • Check that .Where() expressions use supported comparison operators.
  • Confirm methods are chained in a valid order, such as: WhereOrderBySkip and LimitGetAsContentAsync.
  • Build up the query step by step to identify the problem method.

400 – GRAPH_FIELD_UNKNOWN

Message

Unknown field – the query references a non-existent property.

Possible causes

  • Field name is misspelled in the query.
  • Property does not exist on the content type.
  • Property is not indexed in Content Graph.
  • Case-sensitivity mismatch (field names are case-sensitive).

Resolution

  • Verify the exact spelling and casing of the field name.
  • Confirm that the property exists on the content type.
  • Confirm that the property is indexed in Content Graph.
  • If you recently added the property, trigger reindexing by running the Graph Full Synchronization scheduled job in CMS.