Skip to content

Commit

Permalink
feat: export TypedDocumentString
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Sep 10, 2024
1 parent 7b105c5 commit 4545eb4
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 101 deletions.
27 changes: 0 additions & 27 deletions examples/output|output_envelope.output.test.txt

This file was deleted.

10 changes: 5 additions & 5 deletions examples/output|output_envelope.output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
headers: Headers {
connection: 'keep-alive',
'content-length': '119',
'x-served-by': 'cache-yul1970043-YUL',
'x-served-by': 'cache-yul1970039-YUL',
'accept-ranges': 'bytes',
date: 'Sun, 08 Sep 2024 18:13:26 GMT',
'content-type': 'application/graphql-response+json; charset=utf-8',
Expand All @@ -32,13 +32,13 @@
'alt-svc': 'h3=":443"; ma=86400',
'access-control-allow-origin': '*',
'x-powered-by': 'Stellate',
age: '95906',
age: '109533',
'cache-control': 'public, s-maxage=2628000, stale-while-revalidate=2628000',
'x-cache': 'HIT',
'x-cache-hits': '1',
'x-cache-hits': '17',
'gcdn-cache': 'HIT',
'stellate-rate-limit-budget-remaining': '13',
'stellate-rate-limit-rules': '"IP limit";type="RequestCount";budget=50;limited=?0;remaining=13;refill=10',
'stellate-rate-limit-budget-remaining': '45',
'stellate-rate-limit-rules': '"IP limit";type="RequestCount";budget=50;limited=?0;remaining=45;refill=60',
'stellate-rate-limit-decision': 'pass',
'stellate-rate-limit-budget-required': '5',
'content-encoding': 'br'
Expand Down
4 changes: 1 addition & 3 deletions examples/raw_rawString_rawTyped__rawString-typed.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { Graffle } from '../src/entrypoints/main.js'
// todo from '../src/entrypoints/utils.js'
import type { TypedDocumentString } from '../src/layers/0_functions/types.js'
import { Graffle, type TypedDocumentString } from '../src/entrypoints/main.js'
import { publicGraphQLSchemaEndpoints, show } from './$/helpers.js'

const graffle = Graffle.create({
Expand Down

This file was deleted.

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': '1725915111383'
'x-sent-at-time': '1725928738805'
},
signal: undefined,
method: 'post',
Expand Down
1 change: 1 addition & 0 deletions src/entrypoints/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export { execute } from '../layers/0_functions/execute.js'
export { gql } from '../layers/0_functions/gql.js'
export { type TypedDocumentString } from '../layers/0_functions/types.js'
// todo figure this export out. Was just put there to resolve a type error about "...cannot be named..."
export * from '../layers/6_client/Settings/Input.js'
// todo figure this export out. Was just put there to resolve a type error about "...cannot be named..."
Expand Down
87 changes: 44 additions & 43 deletions website/.vitepress/configExamples.ts
Original file line number Diff line number Diff line change
@@ -1,75 +1,76 @@
import { DefaultTheme } from 'vitepress'

export const sidebarExamples: DefaultTheme.SidebarItem[] = [
import { DefaultTheme } from 'vitepress'

export const sidebarExamples:DefaultTheme.SidebarItem[] = [
{
'text': 'Transport Memory',
'link': '/examples/transport-memory',
"text": "Transport Memory",
"link": "/examples/transport-memory"
},
{
'text': 'Raw Typed',
'link': '/examples/raw-typed',
"text": "Raw Typed",
"link": "/examples/raw-typed"
},
{
'text': 'Raw String Typed',
'link': '/examples/raw-string-typed',
"text": "Raw String Typed",
"link": "/examples/raw-string-typed"
},
{
'text': 'Raw String',
'link': '/examples/raw-string',
"text": "Raw String",
"link": "/examples/raw-string"
},
{
'text': 'Raw',
'link': '/examples/raw',
"text": "Raw",
"link": "/examples/raw"
},
{
'text': 'Generated',
'items': [
"text": "Generated",
"items": [
{
'text': 'Arguments',
'link': '/examples/generated-arguments',
},
],
"text": "Arguments",
"link": "/examples/generated-arguments"
}
]
},
{
'text': 'Output',
'items': [
"text": "Output",
"items": [
{
'text': 'Default',
'link': '/examples/output-default',
"text": "Default",
"link": "/examples/output-default"
},
{
'text': 'Envelope',
'link': '/examples/output-envelope',
},
],
"text": "Envelope",
"link": "/examples/output-envelope"
}
]
},
{
'text': 'Transport Http',
'items': [
"text": "Transport Http",
"items": [
{
'text': 'Abort',
'link': '/examples/transport-http-abort',
"text": "Abort",
"link": "/examples/transport-http-abort"
},
{
'text': 'Custom Fetch',
'link': '/examples/transport-http-custom-fetch',
"text": "Custom Fetch",
"link": "/examples/transport-http-custom-fetch"
},
{
'text': 'Dynamic Headers',
'link': '/examples/transport-http-dynamic-headers',
"text": "Dynamic Headers",
"link": "/examples/transport-http-dynamic-headers"
},
{
'text': 'Headers',
'link': '/examples/transport-http-headers',
"text": "Headers",
"link": "/examples/transport-http-headers"
},
{
'text': 'Method Get',
'link': '/examples/transport-http-method-get',
"text": "Method Get",
"link": "/examples/transport-http-method-get"
},
{
'text': 'Raw',
'link': '/examples/transport-http-raw',
},
],
},
"text": "Raw",
"link": "/examples/transport-http-raw"
}
]
}
]
10 changes: 5 additions & 5 deletions website/content/examples/output-envelope.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ console.log(result)
headers: Headers {
connection: 'keep-alive',
'content-length': '119',
'x-served-by': 'cache-yul1970043-YUL',
'x-served-by': 'cache-yul1970039-YUL',
'accept-ranges': 'bytes',
date: 'Sun, 08 Sep 2024 18:13:26 GMT',
'content-type': 'application/graphql-response+json; charset=utf-8',
Expand All @@ -59,13 +59,13 @@ console.log(result)
'alt-svc': 'h3=":443"; ma=86400',
'access-control-allow-origin': '*',
'x-powered-by': 'Stellate',
age: '95906',
age: '109533',
'cache-control': 'public, s-maxage=2628000, stale-while-revalidate=2628000',
'x-cache': 'HIT',
'x-cache-hits': '1',
'x-cache-hits': '17',
'gcdn-cache': 'HIT',
'stellate-rate-limit-budget-remaining': '13',
'stellate-rate-limit-rules': '"IP limit";type="RequestCount";budget=50;limited=?0;remaining=13;refill=10',
'stellate-rate-limit-budget-remaining': '45',
'stellate-rate-limit-rules': '"IP limit";type="RequestCount";budget=50;limited=?0;remaining=45;refill=60',
'stellate-rate-limit-decision': 'pass',
'stellate-rate-limit-budget-required': '5',
'content-encoding': 'br'
Expand Down
4 changes: 1 addition & 3 deletions website/content/examples/raw-string-typed.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ aside: false

<!-- dprint-ignore-start -->
```ts twoslash
import { Graffle } from 'graffle'
// todo from 'graffle/utils'
import type { TypedDocumentString } from '../src/layers/0_functions/types.js'
import { Graffle, type TypedDocumentString } from 'graffle'

const graffle = Graffle.create({
schema: `https://countries.trevorblades.com/graphql`,
Expand Down
2 changes: 1 addition & 1 deletion website/content/examples/transport-http-dynamic-headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ await graffle.rawString({ document: `{ languages { code } }` })
headers: Headers {
accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8',
'content-type': 'application/json',
'x-sent-at-time': '1725915111383'
'x-sent-at-time': '1725928738805'
},
signal: undefined,
method: 'post',
Expand Down

0 comments on commit 4545eb4

Please sign in to comment.