Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: support graphql-playground #717

Merged
merged 21 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
200 changes: 194 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions docs/QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,9 @@ With our indexer deployed, we should be able to query for newly indexed data aft
Below, we write a simple GraphQL query that simply returns a few fields from all transactions that we've indexed.

```bash
curl -X POST http://localhost:29987/api/graph/my_project/hello_indexer \
-H 'content-type: application/json' \
-d '{"query": "query { tx { id hash block }}", "params": "b"}' \
| json_pp
curl -X POST -H "Content-Type: application/graphql"
--data '{ "query": "query { tx { id, hash, block } }" }'
http://127.0.0.1:29987/api/graph/my_project/hello_indexer
```

```text
Expand Down
13 changes: 7 additions & 6 deletions docs/src/examples/block-explorer.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Below is an example of a rudimentary block explorer backend implementation that
Once blocks have been added to the database by the indexer, you can query for them by using a query similar to the following:

```sh
curl -X POST http://localhost:29987/api/graph/fuel_examples/explorer_indexer \
-H 'content-type: application/json' \
-d '{"query": "query { block { id height timestamp }}", "params": "b"}' \
| json_pp
curl -X POST -H "Content-Type: application/graphql"
--data '{ "query": "query { block { id, height, timestamp } }" }'
http://127.0.0.1:29987/api/graph/fuel_examples/explorer_indexer
```

```json
[
{
"data": [
{
"height" : 1,
"id" : "f169a30cfcbf1eebd97a07b19de98e4b38a4367b03d1819943be41744339d38a",
Expand All @@ -42,5 +42,6 @@ curl -X POST http://localhost:29987/api/graph/fuel_examples/explorer_indexer \
"id" : "363af43cfd2a6d8af166ee46c15276b24b130fc6a89ce7b3c8737d29d6d0e1bb",
"timestamp" : 1668710314
}
]
]
}
```
2 changes: 2 additions & 0 deletions packages/fuel-indexer-api-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ path = "src/bin/main.rs"

[dependencies]
anyhow = "1.0"
async-graphql = "5.0.7"
async-graphql-axum = "5.0.7"
async-std = "1"
axum = { version = "0.6", features = ["multipart", "macros"] }
clap = { version = "3.1", features = ["cargo", "derive", "env"] }
Expand Down
Loading