---
title: "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceGraph/queries/{resourceName}"
method: PATCH
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceGraph/queries/{resourceName}"
---

# PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceGraph/queries/{resourceName}

`PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceGraph/queries/{resourceName}`

Updates a graph query that has already been added.

## Path parameters

- `subscriptionId` string, required
- `resourceGroupName` string, required
- `resourceName` string, required

## Query parameters

- `api-version` string, required

## Request body

- GraphQueryUpdateParameters — The parameters that can be provided when updating workbook properties properties.
  - `tags` object — Resource tags
  - `etag` string — This will be used to handle Optimistic Concurrency. If not present, it will always overwrite the existing resource without checking conflict.
  - `properties` GraphQueryPropertiesUpdateParameters — Properties that contain a workbook for PATCH operation.
    - `description` string — The description of a graph query.
    - `query` string — KQL query that will be graph.

## Response `200`

The graph query definition updated.

- GraphQueryResource — An azure resource object
  - `id` string — Azure resource Id
  - `name` string — Azure resource name. This is GUID value. The display name should be assigned within properties field.
  - `location` string — The location of the resource
  - `type` string — Azure resource type
  - `etag` string — This will be used to handle Optimistic Concurrency. If not present, it will always overwrite the existing resource without checking conflict.
  - `tags` object — Resource tags

## Other responses

- `default` — Error response describing why the operation failed.

## Changes

- **2019-11-26** (2018-09-01-preview) `9eee4bcdf9f2` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/azure/apis/azure-resource-graph-query/changes/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.ResourceGraph/queries/:resourceName/patch.md)

---

[API](https://skmtc.dev/azure/apis/azure-resource-graph-query.md) · [All operations](https://skmtc.dev/azure/apis/azure-resource-graph-query/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/azure-resource-graph-query/revisions/38a2dcd8c948/schema)
