> For the complete documentation index, see [llms.txt](https://docs.inverter.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inverter.network/sdk/react-sdk/subscribe-to-the-indexer.md).

# Subscribe to the Indexer

Subscribes to the indexer using Web Socket, handles the client cache by using `React.useMemo` just plug it in your client side application and you have a live data feed.

{% hint style="info" %}
Currently `turbo` can cause problems with graphql parsers.
{% endhint %}

{% code overflow="wrap" %}

```typescript
'use client'

import { useGraphQLSubscription } from '@inverter-network/react/client'
import type { GraphQLQueryArgs } from '@inverter-network/graphql'

export default function Page() {
    // Defined the fields which will make the sub query
    const fields = {
      Token: {
        __args: {
          where: {
            address: {
              _eq: '0x961bB3932A7efAa9aDcc7409e1fea090479E8312',
            },
            chainId: {
              _eq: 1101,
            },
          },
        },
        chainId: 1,
        address: 1,
        name: 1,
        decimals: 1,
        symbol: 1,
        totalSupply: 1,
      }
  } as const satisfies GraphQLQueryArgs
    
    const { data, error, isLoading } = useGraphQLSubscription({
        // Optional: enabled, determines if the sub will run
        enabled: true
        fields,
    })
    
    // Return a simple ui to trigger the flow
    return (
        <div className="w-screen h-screen flex flex-col gap-3 items-center justify-center">
            <h1>
                Token Name: {data?.Token[0].name ?? 'No Data Yet...'}
            </h1>
            
            <h1>
                Token Symbol: {data?.Token[0].symbol ?? 'No Data Yet...'}
            </h1>
        </div>
    )
}
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.inverter.network/sdk/react-sdk/subscribe-to-the-indexer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
