# Class: Query

## Query(options)

Service class for querying Cask subgraph data.

## Constructor

#### new Query(options)

Create an instance of the Query service.

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` |  | See CaskSDK configuration.

See:
  - CaskSDK

### Methods

#### (async) consumerSummary(args) → {Promise.<*>}

Get the summary metrics for a specific consumer

##### Parameters:

Name | Type | Description
--- | --- | ---
`args` | Object | Function arguments ###### Properties
Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`address` | string | <optional> | this.ethersConnection.address | Address of consumer

##### Returns:

Type
  Promise.<*>

#### (async) flow(id, type, optionsopt) → {Promise.<*>}

Get the specified flow of a specific type

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`id` | string |  | flow ID
`type` | string |  | Flow type (subscription, dca, p2p or chainlinkTopup)
`options` | Object | <optional> | query options

##### Returns:

Type
  Promise.<*>

#### (async) flows(args) → {Promise.<*>}

Get all flows for an address

##### Parameters:

Name | Type | Description
--- | --- | ---
`args` | Object | Function arguments ###### Properties
Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`address` | string | <optional> | this.ethersConnection.address | Address of user

##### Returns:

Type
  Promise.<*>

#### (async) init(args)

Initialize the query service.

##### Parameters:

Name | Type | Description
--- | --- | ---
`args` | Object | Function arguments ###### Properties
Name | Type | Attributes | Description
--- | --- | --- | ---
`ethersConnection` | EthersConnection | <optional> | EthersConnection instance

#### (async) providerPlanSummary(args) → {Promise.<*>}

Get the summary metrics for a specific provider and plan

##### Parameters:

Name | Type | Description
--- | --- | ---
`args` | Object | Function arguments ###### Properties
Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`address` | string | <optional> | this.ethersConnection.address | Address of user
`planId` | number |  |  | Plan ID

##### Returns:

Type
  Promise.<*>

#### (async) providerSummary(args) → {Promise.<*>}

Get the summary metrics for a specific provider

##### Parameters:

Name | Type | Description
--- | --- | ---
`args` | Object | Function arguments ###### Properties
Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`address` | string | <optional> | this.ethersConnection.address | Address of provider

##### Returns:

Type
  Promise.<*>

#### (async) walletHistory()

Get wallet history for the connected user