Skip to content

Commit 4c62b46

Browse files
add GraphQL Voyager
1 parent cbc4a7b commit 4c62b46

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

GraphQL Voyager/README.MD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# GraphQL Voyager
2+
3+
[GraphQL Voyager](https://github.com/APIs-guru/graphql-voyager) Represent any GraphQL API as an interactive graph. It's time to finally see the graph behind GraphQL.
4+
5+
This GraphQL Voyager is based on bellecour subgraph introspection.

GraphQL Voyager/index.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>iExec PoCo Subgraph Voyager</title>
5+
<script src="https://cdn.jsdelivr.net/npm/react@16/umd/react.production.min.js"></script>
6+
<script src="https://cdn.jsdelivr.net/npm/react-dom@16/umd/react-dom.production.min.js"></script>
7+
<link
8+
rel="stylesheet"
9+
href="https://cdn.jsdelivr.net/npm/graphql-voyager/dist/voyager.css"
10+
/>
11+
<script src="https://cdn.jsdelivr.net/npm/graphql-voyager/dist/voyager.min.js"></script>
12+
</head>
13+
<body>
14+
<div id="voyager">Loading...</div>
15+
<script>
16+
function introspectionProvider(introspectionQuery) {
17+
return fetch(
18+
"https://thegraph.bellecour.iex.ec/subgraphs/name/bellecour/poco-v5",
19+
{
20+
method: "post",
21+
headers: { "Content-Type": "application/json" },
22+
body: JSON.stringify({ query: introspectionQuery }),
23+
}
24+
).then((response) => response.json());
25+
}
26+
GraphQLVoyager.init(document.getElementById("voyager"), {
27+
introspection: introspectionProvider,
28+
});
29+
</script>
30+
</body>
31+
</html>

0 commit comments

Comments
 (0)