GraphQL API for Developers
1.1 API Overview
Authentication Header:
Authorization: Bearer <token>1.2 Configuration
Sample Configuration with Apollo Client (JavaScript):
import { ApolloClient, InMemoryCache, HttpLink } from '@apollo/client';
const client = new ApolloClient({
link: new HttpLink({
uri: 'https://api.capsurelabs.com/graphql',
headers: {
Authorization: `Bearer ${token}`
}
}),
cache: new InMemoryCache()
});1.3 Basic GraphQL Queries
1.3.1 Query: Get User Profile
Query:
Sample Request (cURL):
Sample Response:
1.3.2 Query: Get Asset Price
Query:
Variables:
Sample Request (Postman):
Sample Response:
1.4 Basic Mutations
1.4.1 Mutation: Create NFT
Mutation:
Variables:
Sample Response:
1.5 Real-Time Data Subscriptions (Using WebSocket)
Real-Time Price Updates
Subscription:
Variables:
Sample Response:
Last updated
