The validateQuery() GraphQL query 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.

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 the given datatype, LanguageVersionEnum, is an enumerated list of choices: legacy, xdr1, or xdrdetects1.

For the given datatype, QueryArgument, there are several parameters that may be given. Below is a list of them along with their datatypes and a description of each:

Table: QueryArgument

ParameterTypeRequired[a]DefaultDescription
namestringyes The name of the query argument.
valuestringyes The value fo the query argument.

[a] Some arguments may be required, as indicated in this column. For some fields, this column indicates that a result will always be returned for it.


Returned Datatypes

The returned datatype QueryValidationResult has its own parameters. Below is a list of them along with their datatypes and a description of each:

Table: QueryValidationResult

ParameterTypeRequired[a]DefaultDescription
isValidbooleanyes Whether query is valid. For internal testing.
diagnostics[QueryDiagnostic]yes A diagnostic message from query validation (see QueryDiagnostic Table). For internal testing.

[a] Some arguments may be required, as indicated in this column. For some fields, this column indicates that a result will always be returned for it.