Skip to content

Commit

Permalink
chore(docs/example): config headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Aug 4, 2024
1 parent c3593ae commit ddf27ed
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples/config-http-headers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-disable */

import { gql, Graffle } from '../src/entrypoints/alpha/main.js'

const request = Graffle.create({
schema: `https://countries.trevorblades.com/graphql`,
headers: {
authorization: `Bearer MY_TOKEN`,
},
}).rawOrThrow

const { data } = await request(
gql`
{
countries {
name
}
}
`,
)

console.log(data)

0 comments on commit ddf27ed

Please sign in to comment.