# net.query syntax

## About `net.query` function

Whenever you need to poll realtime data from GraphQL API with SDK - use [net.query](/ever-sdk/reference/types-and-methods/mod_net.md#query) function.

Write your graphql query in playground, copy it and insert into SDK's net.query function. Define variables and execute it.

See All the functions available in API here

## Usage

### Pass parameters via `variables` object

You can pass variables via a separate parameter (graphql-style). You just copy the query from playground and replace the param values with $param\_name and then pass parameters via additional object like this:

{% hint style="success" %}
If you use variables object, you need to wrap your query in\
query MyQuery(params){$param1: Param1Type}.
{% endhint %}

{% hint style="danger" %}
If the parameter is mandatory you must specify its type with exclamation mark on the end like this:\
query MyQuery(params){$param1: Param1Type!}
{% endhint %}

```javascript
await client.net.query({
    query: `query MyQuery($utime: Int){
    blockchain {
        master_seq_no_range(time_end: $utime) { end }
    }
}`,
    variables: { utime },
})
```

### Pass parameters inline

```javascript
await client.net.query({
    query: `
    blockchain {
        master_seq_no_range(time_end: ${utime}) { end }
    }`
})
```

See this sample to understand how to pass variables to the queries

{% embed url="<https://github.com/everx-labs/sdk-samples/tree/master/core-examples/node-js/pagination>" %}


---

# Agent Instructions: 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:

```
GET https://docs.everos.dev/ever-sdk/guides/queries_and_subscriptions/raw_query.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
