-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(graffle): incremental typed client (#848)
- Loading branch information
1 parent
a1e95fa
commit eecf7b9
Showing
4 changed files
with
161 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * as Graffle from '../../layers/5_client/client.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { describe, expect, test } from 'vitest' | ||
import { Graffle } from '../../entrypoints/alpha/main.js' | ||
|
||
describe(`without schemaIndex only raw is available`, () => { | ||
const schema = new URL(`https://foo.io/api/graphql`) | ||
const graffle = Graffle.create({ schema }) | ||
|
||
test(`unavailable methods`, () => { | ||
// @ts-expect-error | ||
expect(graffle.document).toBeUndefined() | ||
// @ts-expect-error | ||
expect(graffle.query).toBeUndefined() | ||
// @ts-expect-error | ||
expect(graffle.subscription).toBeUndefined() | ||
// @ts-expect-error | ||
expect(graffle.mutation).toBeUndefined() | ||
}) | ||
|
||
test(`available methods`, () => { | ||
expect(graffle.raw).toBeTypeOf(`function`) | ||
expect(graffle.rawOrThrow).toBeTypeOf(`function`) | ||
}) | ||
}) |
Oops, something went wrong.