Skip to content

Commit

Permalink
refactor(generator): consolidate schema generator parts (#1200)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt authored Oct 18, 2024
1 parent e593ad5 commit 1752d75
Show file tree
Hide file tree
Showing 55 changed files with 3,214 additions and 2,460 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
"serve:pokemon": "tsx tests/_/services/pokemonManual.ts",
"gen:graffle": "pnpm gen:graffle:tests && pnpm build && cd website && pnpm gen:graffle",
"gen:graffle:tests": "tsx tests/_/schemas/generate.ts && pnpm graffle --project src/extensions/SchemaErrors/tests/fixture",
"gen:graffle:tests2": "tsx tests/_/schemas/generate.ts",
"graffle": "tsx ./src/cli/generate.ts",
"gen:examples": "tsx scripts/generate-examples-derivatives/generate.ts && pnpm format",
"dev": "rm -rf dist && tsc --watch",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import type * as MethodsDocument from './MethodsDocument.js'
import type * as MethodsRoot from './MethodsRoot.js'
import type * as MethodsSelect from './MethodsSelect.js'
import type * as Scalar from './Scalar.js'
import type { Index } from './Schema.js'
import type { Schema } from './Schema.js'

declare global {
export namespace GraffleGlobal {
export interface Schemas {
GraffleSchemaErrors: {
name: Data.Name
index: Index
index: Schema
interfaces: {
MethodsSelect: MethodsSelect.$MethodsSelect
Document: MethodsDocument.BuilderMethodsDocumentFn
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type * as Utilities from '../../../../../../entrypoints/utilities-for-generated.js'
import type { Index } from './Schema.js'
import type { Schema } from './Schema.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,
Schema,
// @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
Expand Down
Loading

0 comments on commit 1752d75

Please sign in to comment.