Skip to content

Commit

Permalink
feat(extension/introspection): add new extension (#1171)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt authored Oct 7, 2024
1 parent a824300 commit ac2da57
Show file tree
Hide file tree
Showing 29 changed files with 7,577 additions and 153 deletions.
14 changes: 14 additions & 0 deletions examples/60_extension/extension_introspection__introspection.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* This example shows how to use the Or Throw extension to throw errors for one-off cases.
*/

import { Introspection } from '../../src/entrypoints/extensions.js'
import { Pokemon } from '../../tests/_/schemas/pokemon/graffle/__.js'
import { interceptAndShowUncaughtErrors, show } from '../$/show.js'

interceptAndShowUncaughtErrors()

const pokemon = Pokemon.create().use(Introspection())

const data = await pokemon.introspect()
show(data)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
headers: Headers {
accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8',
'content-type': 'application/json',
'x-sent-at-time': '1728318376823'
'x-sent-at-time': '1728323083637'
},
signal: undefined,
method: 'post',
Expand Down
2 changes: 1 addition & 1 deletion examples/__outputs__/20_output/output_envelope.output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
headers: Headers {
'content-type': 'application/graphql-response+json; charset=utf-8',
'content-length': '142',
date: 'Mon, 07 Oct 2024 16:26:17 GMT',
date: 'Mon, 07 Oct 2024 17:44:44 GMT',
connection: 'keep-alive',
'keep-alive': 'timeout=5'
},
Expand Down
Loading

0 comments on commit ac2da57

Please sign in to comment.