-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
Copy pathjspm-prepared.html
65 lines (63 loc) · 2.17 KB
/
jspm-prepared.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!doctype html>
<html>
<head></head>
<script type="importmap">
{
"imports": {
"@apollo/client": "https://ga.jspm.io/npm:@apollo/[email protected]/index.js"
},
"scopes": {
"https://ga.jspm.io/": {
"@wry/equality": "https://ga.jspm.io/npm:@wry/[email protected]/lib/index.js",
"@wry/trie": "https://ga.jspm.io/npm:@wry/[email protected]/lib/index.js",
"graphql": "https://ga.jspm.io/npm:[email protected]/index.mjs",
"graphql-tag": "https://ga.jspm.io/npm:[email protected]/lib/index.js",
"optimism": "https://ga.jspm.io/npm:[email protected]/lib/index.js",
"react": "https://ga.jspm.io/npm:[email protected]/dev.index.js",
"symbol-observable": "https://ga.jspm.io/npm:[email protected]/lib/index.js",
"ts-invariant": "https://ga.jspm.io/npm:[email protected]/lib/invariant.js",
"ts-invariant/process/index.js": "https://ga.jspm.io/npm:[email protected]/process/index.js",
"tslib": "https://ga.jspm.io/npm:[email protected]/tslib.es6.mjs",
"zen-observable-ts": "https://ga.jspm.io/npm:[email protected]/module.js"
}
}
}
</script>
<script type="module">
// give playwright time to load
await new Promise((r) => setTimeout(r, 100));
import { ApolloClient, InMemoryCache, gql } from "@apollo/client";
const client = new ApolloClient({
uri: "https://main--hack-the-e-commerce.apollographos.net/graphql",
cache: new InMemoryCache(),
});
client
.query({
query: gql`
query {
products {
id
title
}
}
`,
})
.then((r) => {
const main = document.querySelector("main");
const ul = document.createElement("ul");
main.replaceChildren(ul);
r.data.products.forEach((p) => {
const li = document.createElement("li");
li.textContent = p.title;
ul.appendChild(li);
});
})
.catch(console.error);
</script>
<body>
<h1>https://ga.jspm.io/npm:@apollo/client/index.js</h1>
<main>
<p>loading</p>
</main>
</body>
</html>