Skip to content

refactor(codegen): map GraphQL custom scalars to concrete types - #241

Merged
iamfj merged 1 commit into
nextfrom
issue-199
Jul 2, 2026
Merged

refactor(codegen): map GraphQL custom scalars to concrete types#241
iamfj merged 1 commit into
nextfrom
issue-199

Conversation

@iamfj

@iamfj iamfj commented Jul 2, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Configures GraphQL codegen to map Linear's custom scalars (DateTime, Duration, UUID, JSON, JSONObject, TimelessDate, etc.) to concrete TypeScript types and sets defaultScalarType: "unknown" so any unmapped scalar falls back to unknown instead of the codegen default any. The initiative date-range helper is widened to accept the resulting nullable comparator types (string | null).

Closes #199

Type of change

  • Bug fix
  • New feature
  • Refactor (no behavior change)
  • Documentation
  • Tests
  • Build / CI

Checklist

  • npm run check:ci passes (lint + format)
  • npx tsc --noEmit passes (type check)
  • npm test passes (unit tests)
  • New code has tests (happy path + primary error case)
  • Commit messages follow Conventional Commits

Testing

Ran npm run generate and confirmed the generated src/gql/graphql.ts Scalars block now maps every reachable custom scalar with no any types. Verified npx tsc --noEmit (exit 0), npm run check:ci, and npm test (769 tests pass).

Notes for reviewers

This is a type-level change only — no runtime behavior changes. src/gql/ is git-ignored and regenerated at build time, so no generated files appear in the diff. The entity.ts change is a required consequence: the comparator types are now InputMaybe<...> (string | null) rather than any, so the helper signature was widened to match.

@iamfj
iamfj marked this pull request as ready for review July 2, 2026 11:36
Map Linear's custom scalars (DateTime, Duration, UUID, JSON, etc.) to
concrete TypeScript types and default unmapped scalars to `unknown`,
eliminating the codegen `any` default. Widen the initiative date-range
helper to accept the resulting nullable comparator types.

Refs #199
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

✅ knip — no dead code

No unused files, exports, types, or dependencies detected.

@iamfj
iamfj merged commit dbcc28a into next Jul 2, 2026
10 checks passed
@iamfj
iamfj deleted the issue-199 branch July 2, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

type-architecture: configure GraphQL codegen scalars to avoid generated any

1 participant