-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): add generated examples to website (#1040)
- Loading branch information
1 parent
9747c56
commit eeb59e9
Showing
48 changed files
with
1,002 additions
and
114 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
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
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,32 @@ | ||
import { DefaultTheme } from 'vitepress' | ||
|
||
export const sidebarExamples: DefaultTheme.SidebarItem[] = [ | ||
{ | ||
'text': 'Arguments', | ||
'link': '/examples/arguments', | ||
}, | ||
{ | ||
'text': 'Config Fetch', | ||
'link': '/examples/config-fetch', | ||
}, | ||
{ | ||
'text': 'Config Http Headers', | ||
'link': '/examples/config-http-headers', | ||
}, | ||
{ | ||
'text': 'Raw Typed', | ||
'link': '/examples/raw-typed', | ||
}, | ||
{ | ||
'text': 'Raw', | ||
'link': '/examples/raw', | ||
}, | ||
{ | ||
'text': 'RawString Typed', | ||
'link': '/examples/rawString-typed', | ||
}, | ||
{ | ||
'text': 'RawString', | ||
'link': '/examples/rawString', | ||
}, | ||
] |
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,20 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
```ts twoslash | ||
import './graffle/Global.js' | ||
// ---cut--- | ||
import { Graffle as SocialStudies } from './graffle/__.js' | ||
|
||
const socialStudies = SocialStudies.create() | ||
|
||
const countries = await socialStudies.query.countries({ | ||
$: { filter: { name: { in: ['Canada', 'Germany', 'Japan'] } } }, | ||
name: true, | ||
continent: { name: true }, | ||
}) | ||
|
||
console.log(countries) | ||
// ^? | ||
``` |
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,36 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
```ts twoslash | ||
import './graffle/Global.js' | ||
// ---cut--- | ||
import { Graffle as SocialStudies } from './graffle/__.js' | ||
|
||
const socialStudies = SocialStudies.create() | ||
.use({ | ||
name: `CustomFetch`, | ||
anyware: async ({ exchange }) => { | ||
return await exchange({ | ||
using: { | ||
fetch: async () => { | ||
return new Response( | ||
JSON.stringify({ | ||
data: { countries: [{ name: `Canada Mocked!` }] }, | ||
}), | ||
) | ||
}, | ||
}, | ||
}) | ||
}, | ||
}) | ||
|
||
// todo $scalars does not work | ||
// todo intelisense for $ doesn't work | ||
const countries = await socialStudies.query.countries({ | ||
name: true, | ||
}) | ||
|
||
console.log(countries) | ||
// ^? | ||
``` |
Oops, something went wrong.