Skip to content

Commit

Permalink
gen
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Oct 19, 2024
1 parent 343cae8 commit 2fbcf4f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import type { Schema } from './Schema.js'
declare global {
export namespace GraffleGlobal {
export interface Schemas {
export interface Clients {
default: {
name: Data.Name
schema: Schema
Expand Down
9 changes: 3 additions & 6 deletions src/layers/4_generator/generators/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const ModuleGeneratorGlobal = createModuleGenerator(
const customScalarsProperties = config.schema.kindMap.GraphQLScalarTypeCustom
.map((_) => [_.name, `${identifiers.Scalar}.${_.name}`])

const ClientFields = Code.termObjectFields({
const Clients = Code.termObjectFields({
[config.name]: {
name: `Data.Name`,
schema: identifiers.Schema,
Expand All @@ -48,17 +48,14 @@ export const ModuleGeneratorGlobal = createModuleGenerator(
},
})

// todo rename "Schemas" to "Clients"
code(`
declare global {
export namespace GraffleGlobal {
export interface Schemas {
${ClientFields}
export interface Clients {
${Clients}
}
}
}
`)

return code
},
)
2 changes: 1 addition & 1 deletion website/graffle/modules/Global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { Schema } from './Schema.js'

declare global {
export namespace GraffleGlobal {
export interface Schemas {
export interface Clients {
default: {
name: Data.Name
schema: Schema
Expand Down
2 changes: 1 addition & 1 deletion website/pokemon/modules/Global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { Schema } from './Schema.js'

declare global {
export namespace GraffleGlobal {
export interface Schemas {
export interface Clients {
Pokemon: {
name: Data.Name
schema: Schema
Expand Down

0 comments on commit 2fbcf4f

Please sign in to comment.