API Reference

Was this section helpful?

What made this section unhelpful for you?

Base URL

Production:

http://api.polkadex.trade/graphql

Language Box

Query

The Query type in GraphQL represents the entry point for retrieving data from the API. It defines the available read-only operations (queries) that clients can execute to fetch data.

Mutation

The Mutation type in GraphQL is used for modifying or creating data. It defines the operations (mutations) that allow clients to make changes to the data stored on the server, such as creating, updating, or deleting resources

Was this section helpful?

What made this section unhelpful for you?

cancel_all

Body Parameters

inputobject Required

Payload string for cancelling all orders for a market

Show child attributes

Responses

200
Object

Response Attributes

cancel_allstring

Result string

Was this section helpful?

What made this section unhelpful for you?

POST

/

Select
1 2 3 mutation cancel_all($input: UserActionInput!) { cancel_all(input: $input) }

Response

{
  "cancel_all": null
}

cancel_order

Body Parameters

inputobject Required

Payload string for cancelling an order for a Order ID

Show child attributes

Responses

200
Object

Response Attributes

cancel_orderstring

Result string

Was this section helpful?

What made this section unhelpful for you?

POST

/

Select
1 2 3 mutation cancel_order($input: UserActionInput!) { cancel_order(input: $input) }

Response

{
  "cancel_order": null
}

place_order

Body Parameters

inputobject Required

Payload for placing order

Show child attributes

Responses

200
Object

Response Attributes

place_orderstring

Result string

Was this section helpful?

What made this section unhelpful for you?

POST

/

Select
1 2 3 mutation place_order($input: UserActionInput!) { place_order(input: $input) }

Response

{
  "place_order": null
}

publish

Body Parameters

namestring Required
datastring Required

Responses

200
Object

Response Attributes

publishobject

Show child attributes

Was this section helpful?

What made this section unhelpful for you?

POST

/

Select
1 2 3 4 5 6 mutation publish($name: String!, $data: String!) { publish(name: $name, data: $data) { name data } }

Response

{
  "publish": {
    "name": null,
    "data": null
  }
}

withdraw

Body Parameters

inputobject Required

Payload for withdraw an asset from trading account to funding account

Show child attributes

Responses

200
Object

Response Attributes

withdrawstring

Result string

Was this section helpful?

What made this section unhelpful for you?

POST

/

Select
1 2 3 mutation withdraw($input: UserActionInput!) { withdraw(input: $input) }

Response

{
  "withdraw": null
}

Subscription

The Subscription type in GraphQL enables real-time communication between clients and the server. It defines a set of events or data streams that clients can subscribe to and receive updates whenever the subscribed events occur.

Objects

Objects in GraphQL represent complex data structures. They define the fields and their types that can be queried in a GraphQL API. Objects can have nested fields and relationships with other objects.

Scalars

Scalars: Scalars in GraphQL represent primitive data types, such as String, Int, Boolean, Float, etc. They are used to define the types of individual fields in the GraphQL schema.

Directives

Directives in GraphQL provide a way to control the execution behavior of queries and mutations. They allow you to modify the result, change the execution order, skip or include fields conditionally, and apply custom logic to the resolution process.

Was this section helpful?

What made this section unhelpful for you?

Enums

Enums in GraphQL define a set of possible values for a field. They represent a discrete set of options or states that a field can have. Enums help ensure type safety and provide a clear list of valid values for a field.

Unions

Unions in GraphQL allow you to combine multiple object types into a single type. They represent a result that can be one of several object types. Unions are useful when a field can return different types of objects, and you want to specify all the possible types in the schema.

Was this section helpful?

What made this section unhelpful for you?