GraphQL API

Get started with our GraphQL API

Last updated on December 28, 2021

Explorer

You can run queries on Project Galaxy data using a GraphQL Explorer, with endpoints listed below.

Also, a playground is created in the browser that includes docs, syntax highlighting, and validation errors. You can find all APIs and try writing your own queries in it.

Notion image
 

Endpoints

Production environment:

https://graphigo.prd.galaxy.eco/query

Staging environment:

https://graphigo.stg.galaxy.eco/query

 
 
💁
Get Help If you didn't find what you were looking for or want some help, please join Project Galaxy API Support telegram group for more support.
 

Query type

The Query type contains the API’s top-level entry points for all executable queries.

Query.campaign

Find a campaign. Returns Campaign.

Name
Type
Description
id
ID of the campaign.

Example

Request:

query {
  campaign(id: 120) {
    id
    name
    numberID
    info
    description
    requireEmail
    status
    gasType
    startTime
    chain
    enableWhitelist
  }
}

Response:

{
  "data": {
    "campaign": {
      "id": "GCUKoUUbRo",
      "name": "50 GTC from GitcoinDAO",
      "numberID": 120,
      "info": "- Onboard to GitcoinDAO and get 50 GTC for completing an intermediate mission, with mentorship and support from Austin Griffith.\n- To onboard, use this form: https://form.typeform.com/to/E96KbTSy (mention \"shadowy super coder\" under \"specific skills\" section) \n- In addition to the 50 GTC rewards up for grabs, Gitcoin is also offering hands on support for grant creation leading up to GR11.\n",
      "description": "- Onboard to GitcoinDAO and get 50 GTC for completing an intermediate mission, with mentorship and support from Austin Griffith.\n- To onboard, use this form: https://form.typeform.com/to/E96KbTSy (mention \"shadowy super coder\" under \"specific skills\" section) \n- In addition to the 50 GTC rewards up for grabs, Gitcoin is also offering hands on support for grant creation leading up to GR11.\n",
      "requireEmail": false,
      "status": "Draft",
      "gasType": "GAS",
      "startTime": 1629129600,
      "chain": "RINKEBY",
      "enableWhitelist": true
    }
  }
}
 

Query.nftCore

Find a NFT contract. Returns NFTCore.

Name
Type
Description
address
address of the NFT contract.

Example

Request:

query {
  nftCore(address: "0x574E84F1837a69791379eCb9dbC9CB5c5d92b55E") {
    id
    contractAddress
    spaceStationAddress
    name
    info
    symbol
    chain
    transferable
  }
}

Response:

{
  "data": {
    "nftCore": {
      "id": "7",
      "contractAddress": "0x574E84F1837a69791379eCb9dbC9CB5c5d92b55E",
      "spaceStationAddress": "0x860366952A0CC61196aAA861A71eE7bE3eB6E3eD",
      "name": "KOVAN NFT",
      "info": "KOVAN NFT",
      "symbol": "KN",
      "chain": "KOVAN",
      "transferable": true
    }
  }
}
 

Query.addressInfo

Get information about user. Returns Address.

Name
Type
Description
address
address of the user.

Example

Request:

query {
  addressInfo(address: "0x424B279097560001B35cedDB649838FBb8227009") {
    id
    address
    username
    hasEmail
    eligibleCredentials {
      totalCount
      pageInfo {
        startCursor
        endCursor
        hasNextPage
      }
      list {
        id
        name
        chain
        description
      }
    }
  }
}

Response:

{
  "data": {
    "addressInfo": {
      "id": "faxHzVB7ded6T8UdkZDyMV",
      "address": "0x424B279097560001B35cedDB649838FBb8227009",
      "username": "yijun39",
      "hasEmail": true,
      "eligibleCredentials": {
        "totalCount": 0,
        "pageInfo": {
          "startCursor": "0",
          "endCursor": "-1",
          "hasNextPage": true
        },
        "list": []
      }
    }
  }
}
 

Query.cred

Find a credential. Returns Cred.

Name
Type
Description
id
ID of the credential.

Example

Request:

query {
  cred(id: 1) {
    id
    name
    description
    chain
    type
    curatorAddress
    referenceLink
    itemCount
    subgraph {
      endpoint
      query
      expression
    }
  }
}

Response:

{
  "data": {
    "cred": {
      "id": "1",
      "name": "Static address cred",
      "description": "address cred desc",
      "chain": "ETHEREUM",
      "type": "ADDRESS",
      "curatorAddress": "0x424B279097560001B35cedDB649838FBb8227009",
      "referenceLink": "https://www.notion.so/bulletlabs/Frontend-Web-Credential-refactor-7984231881eb41228cb0d82a2bd91cad",
      "itemCount": 10,
      "subgraph": null
    }
  }
}
 

Connections

Some types in our schema are Connection types - they represent a paginated collection of edges between two nodes in the graph. These follow the Relay cursor connections specification.

 

Pagination arguments

All connection fields support the following pagination arguments:

Name
Type
Description
first
Returns the first n elements from the list.Max value is 1000
after
Returns the elements in the list that come after the specified cursor.

Since these arguments are common to all connection fields, they are not repeated for each connection.

 

Connection fields

All connections have at least the following fields:

Name
Type
Description
totalCount
Total number of items in the current page.
pageInfo
Pagination information.
edges
[edge!]
The edges.
list
[item!]
The list.

The precise type of Edge and List depends on the kind of connection. A AddressConnection will have list that have the type [Address!], and edges that have the type AddressEdge.

 

AddressConnection

The connection type for Address.

Name
Type
Description
totalCount
Total number of addresses in the current page.
edges
[AddressEdge!]
A list of edges.
list
A list of addresses.
pageInfo
Information to aid in pagination.
 

CredItemConnection

The connection type for CredItem.

Name
Type
Description
totalCount
Total number of cred items in the current page.
edges
[CredItemEdge!]
A list of edges.
list
A list of addresses.
pageInfo
Information to aid in pagination.
 

Object types

Object types represent the resources that the Project Galaxy API can return. They contain fields. Each field has its own type, which will either be one of the basic GraphQL scalar types(e.g.: String or Boolean) or other object types. Fields may have arguments.Fields with arguments are exactly like top-level queries, and are listed beneath the table of fields for each object type.

 

Address

Details of an address.

Name
Type
Description
id
ID of the address.
address
Address iteself.
username
Username of the address.
haseEmail
Whether the address has an email.
email
Email of the address.
avatar
Avatar of the address.
eligibleCredentials
EligibleCredentials of the address.
 

Campaign

Information about a campaign.

Name
Type
Description
id
ID of the campaign.
name
Name of the campaign.
info
Information of the campaign.
description
Description of the campaign.
gasType
Gas type of the campaign.
holders
NFT holders address of the campaign.
 

Cred

Details of a credential.

Name
Type
Description
id
ID of the credential.
name
Name of the credential.
description
Description of the credential.
chain
Chain of the credential.
type
Type of the credential.
curatorAddress
Curator Address of the credential.
referenceLink
Reference Link of the credential.
items
CredItemConnection!
A list of addresses of the credential.
 

NFTCore

Details of a NFT contract.

Name
Type
Description
id
ID of the NFT contract.
contractAddress
NFT contract address.
name
Name of the NFT contract.
info
Information of the NFT contract.
symbol
Symbol of the NFT contract.
chain
Chain of the NFT contract.
marketLink
Market link of the NFT contract.
transferable
Whether the NFT is transferable.
 

PageInfo

Information about pagination in a connection.

Name
Type
Description
endCursor
When paginating forwards, the cursor to continue.
hasNextPage
When paginating forwards, are there more items?.
hasPreviousPage
When paginating backwards, are there more items?.
startCursor
When paginating backwards, the cursor to continue.
 
 
Did this answer your question?
😞
😐
🤩