---
# System prepended metadata

title: Some Queries as starting points for Exploring TezGraph

---

# Some Queries as starting points for Exploring TezGraph


## Operations By Hash ---> Bigmap
```graphql
query ByHash {
  operations(
    filter: { hash: "onqVAiujKrHDDpeQwciAwWcCaHKEcnyYcs1pP6Bz3YJaFVy3s1Z" }
    first: 100
  ) {
    total_count
    edges {
      node {
        kind
        hash
        batch_position
        internal
        source {
          address
        }
        bigmap_values(first: 100) {
          total_count
          edges {
            node {
              key_micheline_json
              value_micheline_json
              bigmap {
                key_type
                value_type
              }
            }
          }
        }
      }
    }
  }
}

```
The above query gets an operation with the specified hash. There might be many **internal operations** with the same operation hash. For all of them we query some basic info, as well as the bigmap values they have changed.

## Contracts by prefix, pagination, ---> Metadata and Bigmaps
```graphql=
query Contracts {
  accounts(
    first: 5
    after: "KT18aqCooZxt5VS4vZM6rsJfhf8aDWkkbTT2"
    filter: { address_prefixes: ["KT"] }
  ) {
    page_info {
      has_next_page
      end_cursor
    }
    edges {
      node {
        address
        token_metadata {
          decimals
          name
          symbol
          token_id
          raw
        }
        bigmaps(first: 10) {
          total_count
          edges {
            node {
              annots
              key_type
              value_type
            }
          }
        }
      }
    }
  }
}

```

## Bigmaps by Contract ---> Block, Contract, Operation
```graphql=
query BigmapQuery {
  bigmaps(
    first: 10
    filter: {
      contract: [
        "KT1EqjMLXVxVVQBD8XucsMREHPB9UJbvipre"
        "KT1MMLb2FVrrE9Do74J3FH1RNNc4QhDuVCNX"
      ]
    }
    order_by: { field: annots, direction: asc }
  ) {
    edges {
      cursor
      node {
        annots
        key_type_micheline_json
        key_type
        key_type_michelson
        block {
          level
          hash
        }
        block {
          level
        }
        contract {
          address
        }
        id
        batch_position
        operation {
          hash
        }
      }
    }
  }
}

```

## Operations by Level and kind, Get a Transaction-Specific field -> BigmapValues

```graphql=
query RecentOperations {
  operations(first: 10, filter: { level: 2373147 kind: transaction }) {
    edges {
      node {
        block {
          level
        }
        kind
        hash
        source {
          address
        }
        ... on TransactionRecord {
          amount
        }
        bigmap_values(first: 10) {
          edges {
            node {
              contract {
                address
              }
              key
              value
            }
          }
        }
      }
    }
  }
}

```

## Bigmap by Id -> Get Key and Value
```graphql=
query {
  bigmaps(first: 1, filter: { ids: ["380"] }) {
    edges {
      node {
        key_type
        keys(
          first: 10
          filter: { keys: ["tz1Ke3NL5zRaE42J9QbiAKpgY8SkmNdrtac4"] }
        ) {
          edges {
            node {
              key
              key_michelson
              key_micheline_json
              current_value {
                key
                value
              }
            }
          }
        }
      }
    }
  }
}

```
## BigmapValues by Key -> Bigmap
```graphql=
query fetchBigmapValues {
  bigmap_values(
    first: 10
    filter: {
      bigmap_id: "1264"
      key: "7862616e6b72757074782e74657a"
    }
  ) {
    edges {
      node {
        key
        value_michelson
        block {
          level
        }
        bigmap {
          key_type
          value_type
          value_type_micheline_json
        }
      }
    }
  }
}

```