Skip to content

Latest commit

 

History

History
60 lines (46 loc) · 1.32 KB

calls-with-graphql.md

File metadata and controls

60 lines (46 loc) · 1.32 KB

GraphQL Examples

Make sure you've authenticated with your wallet as shown in authentication.md.

GraphQL API Endpoints

The Golden GraphQL API has a production endpoint at: https://dapp.golden.xyz/graphql

The Golden GraphQL API has a testing endpoint at: https://sandbox.dapp.golden.xyz/graphql. See more at testing-sandbox.md.

Queries and Mutations

Queries and mutations are the two operations allowed in Golden's GraphQL API for retrieving and submitting data to Golden's protocol.

Here are some example queries and mutations:

// Example for finding your account information
// useful for keeping track of your points available to perform actions

query UserInfo {
  currentUser {
    pointsAvailableForActions
    pendingPoints
    stakedPoints
    remainingSkips
  }
}
// Example for retrieving predicates

query MyQuery {
  predicates {
    edges {
      node {
        id
        name
      }
    }
  }
}
// Example for submitting validation

mutation MyMutation {
  createValidation(
    input: {tripleId: "0a87e666-34b4-46ba-999a-70ab81b1f781", validationType: ACCEPTED}
  ) {
    validation {
      id
    }
  }
}