graphql

package
v0.0.0-...-c246823 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// GraphUrlMainnet GraphUrlTestnet According to the https://aptos.dev/guides/indexing/#rate-limits. Both APIs are limited to 300 requests per IP per hour
	GraphUrlMainnet = "https://indexer.mainnet.aptoslabs.com/v1/graphql"
	GraphUrlTestnet = "https://indexer-testnet.staging.gcp.aptosdev.com/v1/graphql"
)

Variables

This section is empty.

Functions

func FetchGraphQL

func FetchGraphQL(operationsDoc, operationName string, variables map[string]interface{}, graphUrl string, out interface{}) error

FetchGraphQL [GraphQL](https://cloud.hasura.io/public/graphiql?endpoint=https://indexer.mainnet.aptoslabs.com/v1/graphql) @param grahpUrl Default mainnet url `https://indexer.mainnet.aptoslabs.com/v1/graphql` if unspecified.

func FetchGraphQLSample

func FetchGraphQLSample(query string, graphUrl string, out interface{}) error

If query has only one statement, `operationName` can be left unspecified

Types

type GraphQLError

type GraphQLError struct {
	Extensions struct {
		Code string `json:"code"`
		Path string `json:"path"`
	} `json:"extensions"`
	Message string `json:"message"`
}

func (GraphQLError) Error

func (e GraphQLError) Error() string

type GraphQLResponse

type GraphQLResponse struct {
	Errors []GraphQLError  `json:"errors,omitempty"`
	Data   json.RawMessage `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL