Skip to main content

Apollo Sandbox

Key Features

  • Interactive Query Builder: Build queries by selecting arguments and fields from the schema documentation.
  • Comprehensive Documentation: Auto-generated documentation for all types and queries including field descriptions.
  • Debugging Tools: Pretty-printed JSON results with collapsible sections and detailed error messages with path highlighting.

Accessing Apollo Sandbox

This link loads Apollo Sandbox pre-configured with the OneSource Web3 API Ethereum endpoint and header key.

Simply replace BP-{KEYVALUE} in the Headers tab with your API key value (BP-{KEYVALUE} only) and you're ready to begin.

Apollo Sandbox Playground

Using Apollo Sandbox

Although the above link to Apollo Sandbox is not pre-configured with query templates like the OneSource Playground, it is quite easy to build your own queries with the Apollo Sandbox interactive query builder.

Below is how you would select arguments and fields to recreate the Get ERC-20 Token Details example query below.

Apollo Sandbox Playground Query Build

warning

It is important to note that Apollo Sandbox by default polls the connected endpoint for schema changes every 5 seconds. Each poll is counted by OneSource as a request against your API key. You may wish to disable this feature so as to conserve your requests, particularly if you intend to be working with the Apollo Sandbox for extended periods of time.

This setting can be disabled by navigating to the settings where you can edit the Connection settings. In the Connection settings menu, toggle the Auto Update feature to the OFF position as shown below.

Apollo Sandbox Playground Connection Settings

Other Features

Apollo Sandbox allows you to retain and reference your history and browse the schema just like the OneSource Playground. You can access these features as shown below.

Apollo Sandbox Playground Other Features

Query Templates

Use these query templates to get acquainted with OneSource.

Please refer to the OneSource Web3 API Reference for comprehensive documentation of all available queries to use as guidance when building your own queries.

Get ERC-20 Token Details

This query fetches all available data about a given ERC-20 token contract.

query Contract($contractId: ID!) {
contract(id: $contractId) {
id
type
name
symbol
decimals
createdAt
createdBlock
holders
}
}

Variables

{
"contractId": "contract-address-here"
}

Get NFT Token Details

This query fetches the name, description, medium thumbnail image, and contract address and type of a given NFT token.

query Token($contract: ID!, $tokenID: ID!) {
token(contract: $contract, tokenID: $tokenID) {
name
description
image {
thumbnails(where: { preset: MEDIUM }) {
url
}
}
contract {
id
isERC721
isERC1155
}
}
}

Variables

{
"contract": "NFT-contract-address-here",
"tokenID": "123"
}

Get NFT Token Details With Image

This query fetches the name, symbol, and type of an NFT contract as well as its token URI and every available media thumbnail size with dimensions and type of each.

query GetTokenWithImage(
$contract: ID!
$tokenID: ID!
) {
token(
contract: $contract
tokenID: $tokenID
) {
contract {
id
type
name
symbol
decimals
}
tokenID
tokenURI
tokenURIStatus
image {
status
url
contentType
width
height
thumbnails {
preset
status
url
width
height
contentType
createdAt
}
createdAt
errorMsg
}
createdAt
createdBlock
}
}

Variables

{
"contract": "NFT-contract-address-here",
"tokenID": "123"
}

Get Wallet Token Balance

This query fetches a wallet's balance of a given ERC-20 token contract as well as the ERC-20 token contract's name, symbol and type. This query could be amended for an ERC-721 or ERC-1155 token by adding the tokenID argument to the query and variables.

query Balance($owner: ID!, $contract: ID!) {
balance(owner: $owner, contract: $contract) {
value
contract {
name
symbol
}
contractType
owner
}
}

Variables

{ "owner": "wallet-address-here",
"contract": "erc-20-contract-address-here"
}

Get All Tokens With Name Containing a Word

This query fetches all tokens with a name containing a word or string of characters.

query Contracts($where: ContractFilter) {
contracts(where: $where) {
contracts {
name
symbol
type
id
}
}
}

Variables

{
"where": {
"name_like": "word-here"
}
}