-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4375b22
commit d452c5e
Showing
28 changed files
with
214 additions
and
161 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
Empty file.
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
19 changes: 19 additions & 0 deletions
19
tests/examples/30_raw/raw_rawDocumentNode__raw-document-node.test.ts
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,19 @@ | ||
// @vitest-environment node | ||
|
||
// WARNING: | ||
// This test is generated by scripts/generate-example-derivatives/generate.ts | ||
// Do not modify this file directly. | ||
|
||
import { expect, test } from 'vitest' | ||
import { runExample } from '../../../scripts/generate-examples-derivatives/helpers.js' | ||
|
||
test(`raw_rawDocumentNode__raw-document-node`, async () => { | ||
const exampleResult = await runExample(`./examples/30_raw/raw_rawDocumentNode__raw-document-node.ts`) | ||
// Examples should output their data results. | ||
const exampleResultMaybeEncoded = exampleResult | ||
// If ever outputs vary by Node version, you can use this to snapshot by Node version. | ||
// const nodeMajor = process.version.match(/v(\d+)/)?.[1] ?? `unknown` | ||
await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( | ||
`../../../examples/__outputs__/30_raw/raw_rawDocumentNode__raw-document-node.output.txt`, | ||
) | ||
}) |
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,19 @@ | ||
// @vitest-environment node | ||
|
||
// WARNING: | ||
// This test is generated by scripts/generate-example-derivatives/generate.ts | ||
// Do not modify this file directly. | ||
|
||
import { expect, test } from 'vitest' | ||
import { runExample } from '../../../scripts/generate-examples-derivatives/helpers.js' | ||
|
||
test(`raw_rawDocumentNode__raw`, async () => { | ||
const exampleResult = await runExample(`./examples/30_raw/raw_rawDocumentNode__raw.ts`) | ||
// Examples should output their data results. | ||
const exampleResultMaybeEncoded = exampleResult | ||
// If ever outputs vary by Node version, you can use this to snapshot by Node version. | ||
// const nodeMajor = process.version.match(/v(\d+)/)?.[1] ?? `unknown` | ||
await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( | ||
`../../../examples/__outputs__/30_raw/raw_rawDocumentNode__raw.output.txt`, | ||
) | ||
}) |
19 changes: 19 additions & 0 deletions
19
tests/examples/30_raw/raw_rawDocumentNode_rawTyped__raw-document-node-typed.test.ts
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,19 @@ | ||
// @vitest-environment node | ||
|
||
// WARNING: | ||
// This test is generated by scripts/generate-example-derivatives/generate.ts | ||
// Do not modify this file directly. | ||
|
||
import { expect, test } from 'vitest' | ||
import { runExample } from '../../../scripts/generate-examples-derivatives/helpers.js' | ||
|
||
test(`raw_rawDocumentNode_rawTyped__raw-document-node-typed`, async () => { | ||
const exampleResult = await runExample(`./examples/30_raw/raw_rawDocumentNode_rawTyped__raw-document-node-typed.ts`) | ||
// Examples should output their data results. | ||
const exampleResultMaybeEncoded = exampleResult | ||
// If ever outputs vary by Node version, you can use this to snapshot by Node version. | ||
// const nodeMajor = process.version.match(/v(\d+)/)?.[1] ?? `unknown` | ||
await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( | ||
`../../../examples/__outputs__/30_raw/raw_rawDocumentNode_rawTyped__raw-document-node-typed.output.txt`, | ||
) | ||
}) |
19 changes: 19 additions & 0 deletions
19
tests/examples/30_raw/raw_rawDocumentNode_rawTyped__raw-typed.test.ts
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,19 @@ | ||
// @vitest-environment node | ||
|
||
// WARNING: | ||
// This test is generated by scripts/generate-example-derivatives/generate.ts | ||
// Do not modify this file directly. | ||
|
||
import { expect, test } from 'vitest' | ||
import { runExample } from '../../../scripts/generate-examples-derivatives/helpers.js' | ||
|
||
test(`raw_rawDocumentNode_rawTyped__raw-typed`, async () => { | ||
const exampleResult = await runExample(`./examples/30_raw/raw_rawDocumentNode_rawTyped__raw-typed.ts`) | ||
// Examples should output their data results. | ||
const exampleResultMaybeEncoded = exampleResult | ||
// If ever outputs vary by Node version, you can use this to snapshot by Node version. | ||
// const nodeMajor = process.version.match(/v(\d+)/)?.[1] ?? `unknown` | ||
await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( | ||
`../../../examples/__outputs__/30_raw/raw_rawDocumentNode_rawTyped__raw-typed.output.txt`, | ||
) | ||
}) |
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,19 @@ | ||
// @vitest-environment node | ||
|
||
// WARNING: | ||
// This test is generated by scripts/generate-example-derivatives/generate.ts | ||
// Do not modify this file directly. | ||
|
||
import { expect, test } from 'vitest' | ||
import { runExample } from '../../../scripts/generate-examples-derivatives/helpers.js' | ||
|
||
test(`anyware`, async () => { | ||
const exampleResult = await runExample(`./examples/40_other/anyware.ts`) | ||
// Examples should output their data results. | ||
const exampleResultMaybeEncoded = exampleResult | ||
// If ever outputs vary by Node version, you can use this to snapshot by Node version. | ||
// const nodeMajor = process.version.match(/v(\d+)/)?.[1] ?? `unknown` | ||
await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( | ||
`../../../examples/__outputs__/40_other/anyware.output.txt`, | ||
) | ||
}) |
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 @@ | ||
<p class="ExampleLinks">Examples <span class="ExampleLinksTitleSeparator">-></span> <a href="../../examples/other/anyware">Anyware</a></p> |
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 |
---|---|---|
@@ -1 +1 @@ | ||
<p class="ExampleLinks">Examples <span class="ExampleLinksTitleSeparator">-></span> <a href="../../examples/transport-http/headers">Headers</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/transport-http/raw">Raw</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw">Raw</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw-string">Raw String</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw-string-typed">Raw String Typed</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw-typed">Raw Typed</a></p> | ||
<p class="ExampleLinks">Examples <span class="ExampleLinksTitleSeparator">-></span> <a href="../../examples/transport-http/headers">Headers</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/transport-http/raw">Raw</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw-document-node">Raw Document Node</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw-document-node-typed">Raw Document Node Typed</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw-string">Raw String</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw-string-typed">Raw String Typed</a></p> |
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 @@ | ||
<p class="ExampleLinks">Examples <span class="ExampleLinksTitleSeparator">-></span> <a href="../../examples/raw/raw-document-node">Raw Document Node</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw-document-node-typed">Raw Document Node Typed</a></p> |
1 change: 1 addition & 0 deletions
1
website/content/_snippets/example-links/rawDocumentNode_rawTyped.md
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 @@ | ||
<p class="ExampleLinks">Examples <span class="ExampleLinksTitleSeparator">-></span> <a href="../../examples/raw/raw-document-node-typed">Raw Document Node Typed</a></p> |
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 |
---|---|---|
@@ -1 +1 @@ | ||
<p class="ExampleLinks">Examples <span class="ExampleLinksTitleSeparator">-></span> <a href="../../examples/raw/raw-string-typed">Raw String Typed</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw-typed">Raw Typed</a></p> | ||
<p class="ExampleLinks">Examples <span class="ExampleLinksTitleSeparator">-></span> <a href="../../examples/raw/raw-document-node-typed">Raw Document Node Typed</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw-string-typed">Raw String Typed</a></p> |
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 @@ | ||
<p class="ExampleLinks">Examples <span class="ExampleLinksTitleSeparator">-></span> <a href="../../examples/raw/raw-document-node">Raw Document Node</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw-document-node-typed">Raw Document Node Typed</a></p> |
1 change: 1 addition & 0 deletions
1
website/content/_snippets/example-links/raw_rawDocumentNode_rawTyped.md
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 @@ | ||
<p class="ExampleLinks">Examples <span class="ExampleLinksTitleSeparator">-></span> <a href="../../examples/raw/raw-document-node-typed">Raw Document Node Typed</a></p> |
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 |
---|---|---|
@@ -1 +1 @@ | ||
<p class="ExampleLinks">Examples <span class="ExampleLinksTitleSeparator">-></span> <a href="../../examples/raw/raw-string-typed">Raw String Typed</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw-typed">Raw Typed</a></p> | ||
<p class="ExampleLinks">Examples <span class="ExampleLinksTitleSeparator">-></span> <a href="../../examples/raw/raw-document-node-typed">Raw Document Node Typed</a> <span class="ExampleLinksSeparator"></span> <a href="../../examples/raw/raw-string-typed">Raw String Typed</a></p> |
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
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
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,29 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
# Anyware | ||
|
||
<!-- dprint-ignore-start --> | ||
```ts twoslash | ||
import { Graffle } from 'graffle' | ||
|
||
Graffle | ||
.create({ schema: `https://countries.trevorblades.com/graphql` }) | ||
.anyware(async ({ encode }) => { | ||
if (encode.input.interface === 'typed') { | ||
// Do something here. | ||
} | ||
|
||
if (encode.input.transport === 'memory') { | ||
// Do something here. | ||
} | ||
|
||
// etc. | ||
|
||
return encode() | ||
}) | ||
``` | ||
<!-- dprint-ignore-end --> | ||
|
||
#### Outputs |
Oops, something went wrong.