> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validio.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Info for a Validator

> Retrieve detailed information about a validator by ID, using GraphQL fragments for reusable selections.

## Overview

Use a known resource, such as a validator, to query for more details about it and the resources it's built on. This recipe uses a validator ID and fetches details about the validator, its source, segmentation, and window, using fragments where possible.

## Steps

**1. Create a fragment**

Fragments are reusable building blocks across one or more queries. This fragment expands the details of a tag, and is used for both the validator's tags and the source's tags.

**2. Construct the query**

Write a `validator` query that selects the fields you need. For the available fields, see the [API documentation](https://docs.validio.io/api-reference.md).

## Full code sample

```python title="Python" theme={null}
import os

from validio_sdk.client import Client


async def example(validator_id: str = os.environ["EXAMPLE_VALIDATOR_ID"]):
    client = Client()
    query = """
    fragment TagsDetails on Tag {
      key
      value
    }

    query ValidatorAndSourceInfo($validatorId: ValidatorId!) {
      validator(id: $validatorId) {
        name
        state
        stats {
          lastArtifactAt
          lastIncidentAt
        }
        tags {
          ... TagsDetails
        }
        sourceConfig {
          source {
            name
            state
            tags {
              ... TagsDetails
            }
            ... on GcpBigQuerySource {
              config {
                project
                dataset
                table
              }
            }
          }
          segmentation {
            name
            fields
          }
          window {
            name
            ... on FixedBatchWindow {
              config {
                batchSize
              }
            }
          }
        }
      }
    }
    """
    result = await client.execute(
        query,
        variable_values={
            "validatorId": validator_id,
        },
    )

    print(result["validator"]["state"])
```
