Skip to content

Commit ddf27ed

Browse files
committed
chore(docs/example): config headers
1 parent c3593ae commit ddf27ed

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

examples/config-http-headers.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* eslint-disable */
2+
3+
import { gql, Graffle } from '../src/entrypoints/alpha/main.js'
4+
5+
const request = Graffle.create({
6+
schema: `https://countries.trevorblades.com/graphql`,
7+
headers: {
8+
authorization: `Bearer MY_TOKEN`,
9+
},
10+
}).rawOrThrow
11+
12+
const { data } = await request(
13+
gql`
14+
{
15+
countries {
16+
name
17+
}
18+
}
19+
`,
20+
)
21+
22+
console.log(data)

0 commit comments

Comments
 (0)