The addRecentQuery() GraphQL mutation is used to add a query to the list of recent queries. The query is a JSON encoded query and visualization structure produced by the user-interface. This field is not yet available. It's described here as a preview.

You can see in the LogScale User Interface, a list of recently run queries or saved queries by clicking on the Queries pull-down menu. Below is a screenshot showing an example of this:

addRecentQuery

Figure 1. addRecentQuery


For more information related to recent queries and saving queries, see the Searching Data documentation page.

Syntax

Below is the syntax for the addRecentQuery() mutation field:

graphql
addRecentQuery(
       input: AddRecentQueryInput!
    ): AddRecentQuery!

Given Datatypes

For the input (i.e., AddRecentQueryInput), there are several parameters that may be given. Below is a list of them along with their data type and a description of each:

Table: AddRecentQueryInput

ParameterTypeRequired[a]DefaultDescription
endstringyes The end of the relative time interval for the query.
isLivebooleanyes Whether the query is live.
optionsJSON  Any options related to the query.
queryArguments[InputDictionaryEntry]yes Arguments related to the recent query, given with key: and value: — with strings for each.
queryStringstringyes The query string.
startstringyes The start of the relative time interval for the query.
viewNamestringyes The name of the view.
widgetTypestring  The type of widget used, if one.

[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.


You'll notice in the table here that one of the data types, InputDictionaryEntry, is a specialized one. However, it simply calls for key/value pairs containing strings.

Returned Datatypes

As indicated by the syntax above, this mutation will return data using the datatype, addRecentQuery(). Below is a list of the parameters of that datatype:

Table: AddRecentQuery

ParameterTypeRequired[a]DefaultDescription
recentQueries[RecentQuery]yes A list of recently run queries (see RecentQuery Table).

[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.