-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce generator extensions
- Loading branch information
1 parent
584dbbe
commit 1d14594
Showing
157 changed files
with
10,442 additions
and
1,225 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,9 @@ | ||
// We import the global module for good measure although it is not clear it is always needed. | ||
// It at least helps with Twoslash wherein without this import here Twoslash will not include the global module. | ||
// In real TypeScript projects it seems the global module is included automatically. But there could be certain tsconfig | ||
// setups where this still indeed does help. | ||
import './modules/Global.js' | ||
|
||
export { create } from './modules/Client.js' | ||
export { Select } from './modules/Select.js' | ||
export * as SelectionSets from './modules/SelectionSets.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * as Graffle from './_.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { createPrefilled } from 'graffle/client' | ||
import { defaultSchemaUrl } from './Data.js' | ||
import { schemaDrivenDataMap } from './SchemaDrivenDataMap.js' | ||
|
||
export const create = createPrefilled(`default`, schemaDrivenDataMap, defaultSchemaUrl) |
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,4 @@ | ||
export const Name = `default` | ||
export type Name = 'default' | ||
|
||
export const defaultSchemaUrl = undefined |
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,24 @@ | ||
import type * as Data from './Data.js' | ||
import type * as MethodsDocument from './MethodsDocument.js' | ||
import type * as MethodsRoot from './MethodsRoot.js' | ||
import type * as MethodsSelect from './MethodsSelect.js' | ||
import type { Index } from './SchemaIndex.js' | ||
|
||
declare global { | ||
export namespace GraffleGlobal { | ||
export interface Schemas { | ||
default: { | ||
name: Data.Name | ||
index: Index | ||
interfaces: { | ||
MethodsSelect: MethodsSelect.$MethodsSelect | ||
Document: MethodsDocument.BuilderMethodsDocumentFn | ||
Root: MethodsRoot.BuilderMethodsRootFn | ||
} | ||
customScalars: {} | ||
|
||
defaultSchemaUrl: null | ||
} | ||
} | ||
} | ||
} |
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,18 @@ | ||
import type * as Utilities from 'graffle/utilities-for-generated' | ||
import type { Index } from './SchemaIndex.js' | ||
import type * as SelectionSets from './SelectionSets.js' | ||
|
||
export interface Document<$Config extends Utilities.Config> { | ||
<$Document>(document: Utilities.ExactNonEmpty<$Document, SelectionSets.$Document>): Utilities.DocumentRunner< | ||
$Config, | ||
Index, | ||
// @ts-expect-error We use Exact instead of constraint on this function. TypeScript does not see that as | ||
// Satisfying the constraint on the DocumentRunner type. | ||
$Document | ||
> | ||
} | ||
|
||
export interface BuilderMethodsDocumentFn extends Utilities.TypeFunction.Fn { | ||
// @ts-expect-error parameter is Untyped. | ||
return: Document<this['params']['config']> | ||
} |
Oops, something went wrong.