---
title: "Query editor | Grafana Plugins documentation"
description: "Use the Infinity query editor to retrieve and transform data from APIs"
---

# Query editor

The Infinity query editor allows you to retrieve data from HTTP endpoints and transform it for visualization in Grafana. This document explains the query editor interface and how to build queries.

## Before you begin

- You must have a configured Infinity data source. Refer to [Configure the Infinity data source](/docs/plugins/yesoreyeram-infinity-datasource/latest/configure/) for instructions.
- Familiarize yourself with the data format you want to query (JSON, CSV, XML, GraphQL, or HTML).

## Query editor overview

The query editor consists of several key components:

Expand table

| Component  | Description                                                               |
|------------|---------------------------------------------------------------------------|
| **Type**   | The data format to query: JSON, CSV, TSV, XML, GraphQL, or HTML           |
| **Parser** | How to process the data: Default, JSONata, JQ, UQL, or GROQ               |
| **Source** | Where to get the data: URL, Inline, Azure Blob, or Reference              |
| **Format** | Output format: Table, Time series, Data frame, Logs, Trace, or Node graph |

## Create a query

To create a basic query:

1. In the query editor, select the **Type** that matches your data format (for example, JSON).
2. Select a **Parser** based on your transformation needs:
   
   - **JSONata** (default) - JSONata expressions, runs in backend (supports alerting)
   - **JQ** - JQ expressions, runs in backend (supports alerting)
   - **UQL** - Unstructured Query Language, runs in frontend
   - **Frontend** - Simple column mapping, runs in frontend
3. Select the **Source**:
   
   - **URL** - Fetch data from an HTTP endpoint
   - **Inline** - Enter data directly in the editor
   - **Azure Blob** - Retrieve from Azure Blob Storage
   - **Reference** - Use pre-configured reference data
4. Select the output **Format** based on your visualization needs.
5. If using URL source, enter the endpoint URL and configure the HTTP method.

## URL configuration

When using URL as the source:

Expand table

| Setting                     | Description                                                                                                                                                                                                               |
|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Method**                  | HTTP method: GET or POST. PUT, PATCH, and DELETE are available only when **Allow dangerous HTTP methods** is enabled in the [data source configuration](/docs/plugins/yesoreyeram-infinity-datasource/latest/configure/). |
| **URL**                     | The endpoint URL                                                                                                                                                                                                          |
| **Headers, Request params** | Click to configure additional headers and query parameters                                                                                                                                                                |

### Use variables in URLs

You can use Grafana variables and time macros in URLs:

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
https://api.example.com/data?from=${__timeFrom}&to=${__timeTo}
```

For more information about URL configuration, refer to [URL configuration](/docs/plugins/yesoreyeram-infinity-datasource/latest/advanced-features/url/).

## Parsing options

The **Parsing options &amp; Result fields** section configures how data is extracted:

Expand table

| Setting       | Description                                                                    |
|---------------|--------------------------------------------------------------------------------|
| **Rows/Root** | JSONata or JQ selector that returns an array of elements from the API response |
| **Columns**   | Define which fields to extract and their data types                            |

### Configure columns

Click **Add Columns** to define the fields to extract:

Expand table

| Property     | Description                                                                |
|--------------|----------------------------------------------------------------------------|
| **Selector** | Path to the field in your data                                             |
| **Title**    | Display name for the column                                                |
| **Type**     | Data type: String, Number, Time, Time (UNIX ms), Time (UNIX s), or Boolean |

## Computed columns, filters, and grouping

The **Computed columns, Filter, Group by** section provides additional data transformation options when using backend parsers (JSONata or JQ):

Expand table

| Feature              | Description                                                      |
|----------------------|------------------------------------------------------------------|
| **Computed Columns** | Create new fields using expressions (for example, `price * qty`) |
| **Filter**           | Filter rows using expressions (for example, `age >= 18`)         |
| **Summarize**        | Aggregate data using functions like `sum()`, `count()`, `mean()` |
| **Summarize By**     | Group aggregations by a field                                    |
| **Summarize Alias**  | Name for the summarized result                                   |

For detailed information about expressions and operators, refer to [JSONata backend parser](/docs/plugins/yesoreyeram-infinity-datasource/latest/query/backend/).

## Parser options

Choose a parser based on your needs:

Expand table

| Parser                | Runs in  | Alerting support | Best for                           |
|-----------------------|----------|------------------|------------------------------------|
| **JSONata** (default) | Backend  | Yes              | Complex transformations, alerting  |
| **JQ**                | Backend  | Yes              | JQ-style queries, alerting         |
| **UQL**               | Frontend | No               | SQL-like queries, pivoting         |
| **Frontend**          | Frontend | No               | Simple queries with column mapping |

For detailed parser documentation:

- [JSONata parser](/docs/plugins/yesoreyeram-infinity-datasource/latest/query/backend/)
- [JQ parser](/docs/plugins/yesoreyeram-infinity-datasource/latest/query/jq-backend/)
- [UQL parser](/docs/plugins/yesoreyeram-infinity-datasource/latest/query/uql/)
- [GROQ parser](/docs/plugins/yesoreyeram-infinity-datasource/latest/query/groq/)

## Output formats

Select the appropriate format for your visualization:

Expand table

| Format                       | Use case                               |
|------------------------------|----------------------------------------|
| **Table**                    | Display data in table panels           |
| **Time series**              | Time-based data for graph panels       |
| **Data frame**               | Generic format for most visualizations |
| **Logs**                     | Log data for the Logs panel            |
| **Trace**                    | Trace data for the Traces panel        |
| **Node graph (nodes/edges)** | Network topology visualization         |

For specialized formats, refer to:

- [Logs format](/docs/plugins/yesoreyeram-infinity-datasource/latest/advanced-features/logs/)
- [Tracing format](/docs/plugins/yesoreyeram-infinity-datasource/latest/advanced-features/tracing/)
- [Node graph format](/docs/plugins/yesoreyeram-infinity-datasource/latest/advanced-features/node-graph/)

## Use queries for alerting

To use Infinity queries with Grafana Alerting, you must use a **backend parser** (JSONata or JQ). Frontend parsers (Default, UQL, GROQ) do not support alerting.

Backend parsers also enable:

- [Recorded queries](/docs/grafana/latest/administration/recorded-queries/)
- [Query caching](/docs/grafana/latest/administration/data-source-management/#query-and-resource-caching)
- [Shared dashboards](/docs/grafana/latest/dashboards/share-dashboards-panels/shared-dashboards/)
- [SQL expressions](/docs/grafana/latest/panels-visualizations/query-transform-data/sql-expressions/)

## Use the parsing assistant

Click **Use Assistant to parse data** to open the AI-powered parsing assistant. The assistant can help you:

- Automatically detect data structure
- Suggest column configurations
- Generate parser expressions

> Note
> 
> The parsing assistant requires Grafana’s AI features to be enabled.

## Next steps

- Learn about [data formats](/docs/plugins/yesoreyeram-infinity-datasource/latest/data-formats/) supported by Infinity
- Explore [macros](/docs/plugins/yesoreyeram-infinity-datasource/latest/query/macros/) for dynamic queries
- Set up [template variables](/docs/plugins/yesoreyeram-infinity-datasource/latest/variables/template-variables/) for interactive dashboards
