Skip to content

Some scalar names conflict with TypeScript syntax #1354

@fiadliel

Description

@fiadliel

Description

Some TypeScript type names are derived from the GraphQL scalar name in such a way that they conflict with TypeScript syntax. I have one example here; the scalar named bigint causes tsc errors.

Reproduction Steps/Repo Link

Use a schema like

scalar bigint

type Query {
  b: bigint
}

Run tsc --noEdit, it will return these errors:

.../modules/scalar.ts:16:13 - error TS2457: Type alias name cannot be 'bigint'.

16 export type bigint = $$Utilities.Schema.Scalar.ScalarCodecless<"bigint">;
               ~~~~~~

.../modules/schema.ts:254:20 - error TS2724: '".../modules/schema".Schema' has no exported member named 'bigint'. Did you mean '$bigint'?

254     bigint: Schema.bigint;
                       ~~~~~~

(actually the issue on line 254 looks a little different, a mistake in how this value is escaped - not sure if worth reporting separately)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions