The validateQuery() GraphQL query is used to check that a query compiles. This field is not yet available. It's described here as a preview and is used only for internal testing. Use analyzeQuery() , instead.

For more information on saved queries, see the User Functions (Saved Searches) reference page where saved queries are discussed. Also, look at the Searching Data documentation page as it relates to recent queries and saving queries.

Syntax

Below is the syntax for the validateQuery() query field:

graphql
validateQuery(
     queryString: string!
     version: LanguageVersionEnum!
     isLive: boolean
     arguments: [QueryArgument!]
   ): QueryValidationResult!

Given Datatypes

For version, see LanguageVersionEnum. For arguments, the datatype QueryArgument, there are a couple parameters. Below is a list of them along with their datatypes and a description of each:

Table: QueryArgument

ParameterTypeRequiredDefaultDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Sep 19, 2024
namestringyes The name of the query argument.
valuestringyes The value fo the query argument.

Returned Datatypes

The returned datatype QueryValidationResult has its own parameters. They're listed in the table here:

Table: QueryValidationResult

ParameterTypeRequiredDefaultDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Oct 2, 2024
diagnostics[QueryDiagnostic]yes A diagnostic message from query validation. See QueryDiagnostic. This is a preview for internal testing and subject to change.
isValidbooleanyes Whether query is valid. For internal testing.