Queries for Chains

chain

Returns a single chain by id or name.

chain(id, name) {
  /* Chain fields */
}

Arguments

id Int

The ID of the Chain to return.

name String

The name of the Chain to return.

Response

Chain.* Chain

Any requested field from the Chain object.

Example

Request

query {
  chain(id: 2) {
    id
    ex_chain_id
    name
    logo_media {
      media_type_id
      url
    }
  }
}
query {
  chain(name: "Polygon") {
    id
    ex_chain_id
    name
    logo_media {
      media_type_id
      url
    }
  }
}

Response

{
  "data": {
    "chain": {
      "id": 2,
      "ex_chain_id": 137,
      "name": "Polygon",
      "logo_media": {
        "media_type_id": 1,
        "url": "https://parcel-static-host.s3.amazonaws.com/media/chains/2/logo.svg"
      }
    }
  }
}

chains

Returns all available chains supported by Parcel.

chains {
  /* Chain fields */
}

Arguments

None

Response

Chain.* [Chain!]

A list of Chain objects returning any requested fields from the Chain object.

Example

Request

query {
  chains {
    id
    name
  }
}

Response

{
  "data": {
    "chains": [
      {
        "id": 1,
        "name": "Ethereum"
      },
      {
        "id": 2,
        "name": "Polygon"
      }
    ]
  }
}