# GraphQL API

Boost daemon exposes a GraphQL API that is used by the Web UI to query and update information about storage and retrieval deals.

The GraphQL API query endpoint is at <http://localhost:8080/graphql/query>

You can also run your own queries against the GraphQL API using `curl` or a programming language that has a [GraphQL client](https://graphql.org/code/).

Boost has a built-in GraphQL explorer at <http://localhost:8080/graphiql>

You can test out queries, or explore the GraphQL API by clicking on the `< Docs` link at the top right of the page:

![](/files/3eMneC3qMu5MVXSkKbHJ)

To run a GraphQL query with `curl`:

```
curl -X POST
-H "Content-Type: application/json"
-d '{"query":"query { deals(offset: 5, limit: 10) { deals { ID CreatedAt PieceCid } } }"}'
http://localhost:8080/graphql/query | jq
```

This 1m video shows how to use these tools to build an run a GraphQL query against Boost:

{% embed url="<https://youtu.be/yN_H-hDrBao>" %}
Use the GraphQL explorer to create a query against Boost
{% endembed %}

### Example Queries

1\. Query failed deals

```
curl -X POST \
-H "Content-Type: application/json" \
-d '{"query":"query { deals(limit: 10, query: \"failed to get size of imported\") { deals { ID CreatedAt Message } } }"}' \
http://localhost:8080/graphql/query | jq
```

2\. Cancel a deal where `ab12345c-5678-90de-12f3-45a6b78cd9ef` is the deal ID

```
curl -X POST \
-H "Content-Type: application/json" \
-d '{"query":"mutation { dealCancel(id: \"ab12345c-5678-90de-12f3-45a6b78cd9ef\") }"}' \
http://localhost:8080/graphql/query | jq
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boost.filecoin.io/deployment/boost-architecture/graphql-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
