Skip to content

feat: Replace custom Date/DateTime/UUID scalars with graphql-scalars package and add JSON/JSONObject scalar support#673

Merged
kingston merged 2 commits into
mainfrom
kingston/eng-813-replace-custom-graphql-scalars-with-graphql-scalars-package
Oct 10, 2025
Merged

feat: Replace custom Date/DateTime/UUID scalars with graphql-scalars package and add JSON/JSONObject scalar support#673
kingston merged 2 commits into
mainfrom
kingston/eng-813-replace-custom-graphql-scalars-with-graphql-scalars-package

Conversation

@kingston

@kingston kingston commented Oct 10, 2025

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Added JSON and JSONObject GraphQL scalars across example backends and generators.
  • Breaking Changes
    • Date now uses RFC 3339 format; DateTime normalizes non-UTC inputs to UTC; UUID validation is stricter.
  • Documentation
    • Enhanced scalar descriptions in the GraphQL schema.
  • Chores
    • Adopted graphql-scalars; removed uuid dependency.
    • Removed lint-staged and the pre-commit lint hook from examples.
  • Style
    • Minor formatting cleanups in generated route type files (semicolon and punctuation normalization).

@changeset-bot

changeset-bot Bot commented Oct 10, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7d0cb08

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@baseplate-dev/fastify-generators Patch
@baseplate-dev/project-builder-server Patch
@baseplate-dev/plugin-auth Patch
@baseplate-dev/plugin-queue Patch
@baseplate-dev/plugin-storage Patch
@baseplate-dev/project-builder-cli Patch
@baseplate-dev/project-builder-common Patch
@baseplate-dev/project-builder-test Patch
@baseplate-dev/project-builder-web Patch
@baseplate-dev/create-project Patch
@baseplate-dev/code-morph Patch
@baseplate-dev/core-generators Patch
@baseplate-dev/project-builder-lib Patch
@baseplate-dev/react-generators Patch
@baseplate-dev/sync Patch
@baseplate-dev/tools Patch
@baseplate-dev/ui-components Patch
@baseplate-dev/utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Oct 10, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
baseplate-project-builder-web Ready Ready Preview Comment Oct 10, 2025 0:03am

@coderabbitai

coderabbitai Bot commented Oct 10, 2025

Copy link
Copy Markdown

Walkthrough

Migrates custom GraphQL scalars (Date, DateTime, Uuid) to graphql-scalars resolvers and introduces JSON/JSONObject scalars. Updates generators, templates, and package dependencies accordingly. Adjusts builder typings and schema docs. Removes lint-staged and a pre-commit lint hook. Minor formatting changes in generated route trees and a whitespace tweak in a Prisma config.

Changes

Cohort / File(s) Summary
Changeset
.changeset/replace-custom-scalars-with-graphql-scalars.md
Records migration to graphql-scalars, adds JSON/JSONObject, notes breaking changes and dependency updates.
Repo tooling/config
.claude/settings.json, .husky/pre-commit
Replaces permissions with env config; removes pre-commit lint-staged invocation.
Examples: remove lint-staged
examples/blog-with-auth/package.json, examples/todo-with-auth0/package.json
Drops lint-staged devDependency and config.
Blog example: scalar wiring
examples/blog-with-auth/packages/backend/baseplate/file-id-map.json, .../src/modules/graphql/index.ts, .../src/plugins/graphql/builder.ts, .../src/modules/graphql/scalars/.templates-info.json
Adds JSON/JSONObject scalar entries to file maps, imports, builder types, and templates metadata.
Blog example: scalar impls
examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date.ts, .../date-time.ts, .../uuid.ts, .../json.ts, .../json-object.ts
Replaces custom Date/DateTime/Uuid with graphql-scalars resolvers; adds JSON and JSONObject scalars.
Blog example: deps
examples/blog-with-auth/packages/backend/package.json
Adds graphql-scalars; removes uuid and @types/uuid.
Auth0 example: schema/docs
examples/todo-with-auth0/packages/backend/schema.graphql
Updates Date/DateTime docs; adds JSON and JSONObject scalars; updates Uuid description.
Auth0 example: scalar wiring
examples/todo-with-auth0/packages/backend/baseplate/file-id-map.json, .../src/modules/graphql/index.ts, .../src/plugins/graphql/builder.ts, .../src/modules/graphql/scalars/.templates-info.json
Adds JSON/JSONObject scalar entries to file maps, imports, builder types, and templates metadata.
Auth0 example: scalar impls
examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date.ts, .../date-time.ts, .../uuid.ts, .../json.ts, .../json-object.ts
Replaces custom Date/DateTime/Uuid with resolvers; adds JSON and JSONObject scalars.
Auth0 example: generated routes formatting
examples/todo-with-auth0/packages/admin/src/route-tree.gen.ts, examples/todo-with-auth0/packages/web/src/route-tree.gen.ts
Removes trailing semicolons and minor punctuation; no logic changes.
fastify-generators: constants
packages/fastify-generators/src/constants/fastify-packages.ts
Adds graphql-scalars: 1.23.0 to FASTIFY_PACKAGES.
fastify-generators: scalar generator configs
packages/fastify-generators/src/generators/pothos/pothos-scalar/extractor.json, .../pothos-scalar.generator.ts
Adds JSON/JSONObject templates/configs; switches Date/DateTime/Uuid to graphql-scalars; removes errorHandler imports usage.
fastify-generators: scalar templates
packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date.ts, .../date-time.ts, .../uuid.ts, .../json.ts, .../json-object.ts
Template implementations now use graphql-scalars resolvers; adds JSON/JSONObject templates.
fastify-generators: typing/mappings
packages/fastify-generators/src/types/field-types.ts, .../writers/pothos/scalars.ts, .../writers/prisma-schema/fields.ts
Adds jsonObject scalar type and mappings (TS and Prisma).
Prisma config whitespace
packages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.mts
Inserts a blank line; no behavior change.
Project builder
packages/project-builder-server/src/compiler/backend/fastify.ts
Registers new JSON and JSONObject scalar generators in GraphQL bundle.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant G as GraphQL Server
  participant P as Pothos Schema
  participant S as graphql-scalars Resolver

  C->>G: GraphQL operation with scalar fields (Date/DateTime/Uuid/JSON/JSONObject)
  G->>P: Validate & coerce inputs
  P->>S: Delegate scalar parseValue/parseLiteral
  S-->>P: Coerced value or error
  P-->>G: Resolved inputs
  G->>G: Execute resolvers
  G->>P: Serialize outputs
  P->>S: Delegate scalar serialize
  S-->>P: Serialized value
  P-->>G: Final response payload
  G-->>C: Response
  note over S,P: Custom inline logic replaced by library resolvers
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the primary change—migrating existing Date, DateTime, and UUID scalars to use the graphql-scalars package and introducing JSON/JSONObject scalars—and aligns with the pull request’s content without extraneous details.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kingston/eng-813-replace-custom-graphql-scalars-with-graphql-scalars-package

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgraphql-scalars@​1.23.01001008887100

View full report

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
examples/todo-with-auth0/packages/backend/package.json (1)

65-65: Bump graphql-scalars to 1.24.2
No security advisories found for v1.23.0, but a newer patch (1.24.2) is available—update to the latest for any minor fixes.

.changeset/replace-custom-scalars-with-graphql-scalars.md (1)

15-20: Consider adding migration guidance for breaking changes.

The breaking changes are well-documented, but users would benefit from explicit migration steps or code examples showing how to update existing implementations that rely on the old behavior.

For example:

  • How to handle existing Date strings that don't conform to RFC 3339
  • How to adjust DateTime handling if code expects non-UTC timestamps
  • Whether UUID validation failures will require data cleanup

This guidance could be added to the changeset or to a migration guide referenced from the changeset.

packages/fastify-generators/src/generators/pothos/pothos-scalar/pothos-scalar.generator.ts (1)

117-174: Add JSDoc to exported generator.

The exported pothosScalarGenerator is missing JSDoc documentation, which is required by the coding guidelines for all exported functions, interfaces, and classes in this path pattern.

Add JSDoc above the export:

+/**
+ * Generator for Pothos GraphQL scalar types.
+ * Supports DateTime, Date, UUID, JSON, and JSONObject scalars using graphql-scalars resolvers.
+ *
+ * @example
+ * // Usage in generator configuration
+ * { type: 'dateTime' }
+ */
 export const pothosScalarGenerator = createGenerator({
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 625a905 and 7d0cb08.

⛔ Files ignored due to path filters (23)
  • examples/blog-with-auth/packages/backend/baseplate/generated/package.json is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/packages/backend/baseplate/generated/src/modules/graphql/index.ts is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/packages/backend/baseplate/generated/src/modules/graphql/scalars/date-time.ts is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/packages/backend/baseplate/generated/src/modules/graphql/scalars/date.ts is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/packages/backend/baseplate/generated/src/modules/graphql/scalars/json-object.ts is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/packages/backend/baseplate/generated/src/modules/graphql/scalars/json.ts is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/packages/backend/baseplate/generated/src/modules/graphql/scalars/uuid.ts is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/packages/backend/baseplate/generated/src/plugins/graphql/builder.ts is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • examples/todo-with-auth0/packages/admin/src/generated/graphql.tsx is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/packages/backend/baseplate/generated/package.json is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/packages/backend/baseplate/generated/src/modules/graphql/index.ts is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/packages/backend/baseplate/generated/src/modules/graphql/scalars/date-time.ts is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/packages/backend/baseplate/generated/src/modules/graphql/scalars/date.ts is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/packages/backend/baseplate/generated/src/modules/graphql/scalars/json-object.ts is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/packages/backend/baseplate/generated/src/modules/graphql/scalars/json.ts is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/packages/backend/baseplate/generated/src/modules/graphql/scalars/uuid.ts is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/packages/backend/baseplate/generated/src/plugins/graphql/builder.ts is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/packages/web/src/generated/graphql.tsx is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/generated/template-paths.ts is excluded by !**/generated/**, !**/generated/**
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/generated/template-renderers.ts is excluded by !**/generated/**, !**/generated/**
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/generated/typed-templates.ts is excluded by !**/generated/**, !**/generated/**
📒 Files selected for processing (41)
  • .changeset/replace-custom-scalars-with-graphql-scalars.md (1 hunks)
  • .claude/settings.json (1 hunks)
  • .husky/pre-commit (0 hunks)
  • examples/blog-with-auth/package.json (0 hunks)
  • examples/blog-with-auth/packages/backend/baseplate/file-id-map.json (1 hunks)
  • examples/blog-with-auth/packages/backend/package.json (1 hunks)
  • examples/blog-with-auth/packages/backend/src/modules/graphql/index.ts (1 hunks)
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/.templates-info.json (1 hunks)
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date-time.ts (1 hunks)
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date.ts (1 hunks)
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json-object.ts (1 hunks)
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json.ts (1 hunks)
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/uuid.ts (1 hunks)
  • examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts (1 hunks)
  • examples/todo-with-auth0/package.json (0 hunks)
  • examples/todo-with-auth0/packages/admin/src/route-tree.gen.ts (5 hunks)
  • examples/todo-with-auth0/packages/backend/baseplate/file-id-map.json (1 hunks)
  • examples/todo-with-auth0/packages/backend/package.json (1 hunks)
  • examples/todo-with-auth0/packages/backend/schema.graphql (3 hunks)
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/index.ts (1 hunks)
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/.templates-info.json (1 hunks)
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date-time.ts (1 hunks)
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date.ts (1 hunks)
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json-object.ts (1 hunks)
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json.ts (1 hunks)
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/uuid.ts (1 hunks)
  • examples/todo-with-auth0/packages/backend/src/plugins/graphql/builder.ts (1 hunks)
  • examples/todo-with-auth0/packages/web/src/route-tree.gen.ts (1 hunks)
  • packages/fastify-generators/src/constants/fastify-packages.ts (1 hunks)
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/extractor.json (1 hunks)
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/pothos-scalar.generator.ts (4 hunks)
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date-time.ts (1 hunks)
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date.ts (1 hunks)
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json-object.ts (1 hunks)
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json.ts (1 hunks)
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/uuid.ts (1 hunks)
  • packages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.mts (1 hunks)
  • packages/fastify-generators/src/types/field-types.ts (2 hunks)
  • packages/fastify-generators/src/writers/pothos/scalars.ts (1 hunks)
  • packages/fastify-generators/src/writers/prisma-schema/fields.ts (1 hunks)
  • packages/project-builder-server/src/compiler/backend/fastify.ts (1 hunks)
💤 Files with no reviewable changes (3)
  • .husky/pre-commit
  • examples/todo-with-auth0/package.json
  • examples/blog-with-auth/package.json
🧰 Additional context used
📓 Path-based instructions (12)
**/*

📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)

Use kebab-case for file names

Files:

  • examples/blog-with-auth/packages/backend/package.json
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/uuid.ts
  • examples/todo-with-auth0/packages/backend/schema.graphql
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date-time.ts
  • packages/fastify-generators/src/types/field-types.ts
  • examples/blog-with-auth/packages/backend/baseplate/file-id-map.json
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json-object.ts
  • examples/todo-with-auth0/packages/backend/src/plugins/graphql/builder.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/index.ts
  • packages/fastify-generators/src/writers/prisma-schema/fields.ts
  • packages/fastify-generators/src/writers/pothos/scalars.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/index.ts
  • examples/todo-with-auth0/packages/backend/baseplate/file-id-map.json
  • packages/project-builder-server/src/compiler/backend/fastify.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/pothos-scalar.generator.ts
  • examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json-object.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/uuid.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date-time.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json.ts
  • examples/todo-with-auth0/packages/web/src/route-tree.gen.ts
  • examples/todo-with-auth0/packages/backend/package.json
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json-object.ts
  • examples/todo-with-auth0/packages/admin/src/route-tree.gen.ts
  • packages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.mts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date-time.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/uuid.ts
  • packages/fastify-generators/src/constants/fastify-packages.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/extractor.json
examples/blog-with-auth/{package.json,packages/**/package.json}

📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)

Use ESM only by setting "type": "module" in package.json

Files:

  • examples/blog-with-auth/packages/backend/package.json
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)

**/*.{ts,tsx}: TypeScript with strict type checking
Always include return types on top-level functions including React components (React.ReactElement)
Include absolute paths in import statements via tsconfig paths (@src/ is the alias for src/)
If a particular interface or type is not exported, change the file so it is exported

If a particular interface or type is not exported in a TypeScript file, modify the file to export it

Files:

  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/uuid.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date-time.ts
  • packages/fastify-generators/src/types/field-types.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json-object.ts
  • examples/todo-with-auth0/packages/backend/src/plugins/graphql/builder.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/index.ts
  • packages/fastify-generators/src/writers/prisma-schema/fields.ts
  • packages/fastify-generators/src/writers/pothos/scalars.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/index.ts
  • packages/project-builder-server/src/compiler/backend/fastify.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/pothos-scalar.generator.ts
  • examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json-object.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/uuid.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date-time.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json.ts
  • examples/todo-with-auth0/packages/web/src/route-tree.gen.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json-object.ts
  • examples/todo-with-auth0/packages/admin/src/route-tree.gen.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date-time.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/uuid.ts
  • packages/fastify-generators/src/constants/fastify-packages.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)

Node 16 module resolution - include file extensions in imports (.js)

Files:

  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/uuid.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date-time.ts
  • packages/fastify-generators/src/types/field-types.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json-object.ts
  • examples/todo-with-auth0/packages/backend/src/plugins/graphql/builder.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/index.ts
  • packages/fastify-generators/src/writers/prisma-schema/fields.ts
  • packages/fastify-generators/src/writers/pothos/scalars.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/index.ts
  • packages/project-builder-server/src/compiler/backend/fastify.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/pothos-scalar.generator.ts
  • examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json-object.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/uuid.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date-time.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json.ts
  • examples/todo-with-auth0/packages/web/src/route-tree.gen.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json-object.ts
  • examples/todo-with-auth0/packages/admin/src/route-tree.gen.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date-time.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/uuid.ts
  • packages/fastify-generators/src/constants/fastify-packages.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)

**/*.{ts,tsx,js}: Sort imports by group: external libs first, then local imports
Use camelCase for variables/functions, PascalCase for types/classes
Order functions such that functions are placed below the variables/functions they use
We use the prefer using nullish coalescing operator (??) ESLint rule instead of a logical or (||), as it is a safer operator
Use console.info/warn/error instead of console.log

Files:

  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/uuid.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date-time.ts
  • packages/fastify-generators/src/types/field-types.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json-object.ts
  • examples/todo-with-auth0/packages/backend/src/plugins/graphql/builder.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/index.ts
  • packages/fastify-generators/src/writers/prisma-schema/fields.ts
  • packages/fastify-generators/src/writers/pothos/scalars.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/index.ts
  • packages/project-builder-server/src/compiler/backend/fastify.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/pothos-scalar.generator.ts
  • examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json-object.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/uuid.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date-time.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json.ts
  • examples/todo-with-auth0/packages/web/src/route-tree.gen.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json-object.ts
  • examples/todo-with-auth0/packages/admin/src/route-tree.gen.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date-time.ts
  • packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/uuid.ts
  • packages/fastify-generators/src/constants/fastify-packages.ts
examples/blog-with-auth/packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)

examples/blog-with-auth/packages/**/src/**/*.{ts,tsx}: Always use .js extensions in import statements (even when importing from TypeScript files)
Use import type for type-only imports
Always specify explicit return types for all functions
Add JSDoc to all exported functions, interfaces, and classes (document parameters, return values, and fields)

Files:

  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/uuid.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/index.ts
  • examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json-object.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date-time.ts
examples/todo-with-auth0/packages/backend/**/schema.graphql

📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)

Backend must generate schema.graphql for the admin package to consume for code generation

Files:

  • examples/todo-with-auth0/packages/backend/schema.graphql
examples/todo-with-auth0/packages/{admin,backend}/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)

examples/todo-with-auth0/packages/{admin,backend}/src/**/*.{ts,tsx}: Always use .js extensions in import statements, even when importing from TypeScript files
Use import type for type-only imports in TypeScript
Always specify explicit return types for all functions

Files:

  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date-time.ts
  • examples/todo-with-auth0/packages/backend/src/plugins/graphql/builder.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/index.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/uuid.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json-object.ts
  • examples/todo-with-auth0/packages/admin/src/route-tree.gen.ts
examples/todo-with-auth0/{packages/admin/src/{app,components,pages,hooks,services}/**/*.{ts,tsx},packages/backend/src/{modules,plugins,prisma,services,utils}/**/*.{ts,tsx}}

📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)

Add JSDoc to all exported functions, interfaces, and classes including descriptions, params, returns, and fields (exclude generated code)

Files:

  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date-time.ts
  • examples/todo-with-auth0/packages/backend/src/plugins/graphql/builder.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/index.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/uuid.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json.ts
  • examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json-object.ts
**/index.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)

Prefer barrel exports e.g. export * from './foo.js' instead of individual named exports

Files:

  • examples/todo-with-auth0/packages/backend/src/modules/graphql/index.ts
  • examples/blog-with-auth/packages/backend/src/modules/graphql/index.ts
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

When adding or changing a feature, add a new Changeset in .changeset/ with patch bump frontmatter and a description

Files:

  • .changeset/replace-custom-scalars-with-graphql-scalars.md
examples/todo-with-auth0/{package.json,packages/**/package.json}

📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)

examples/todo-with-auth0/{package.json,packages/**/package.json}: Module system must be ESM only ("type": "module" in package.json)
Package manager is pnpm 10+ (enforce via packageManager field)
Node version 22+ with Volta pinned to 22.18.0

Files:

  • examples/todo-with-auth0/packages/backend/package.json
🧠 Learnings (2)
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/{package.json,packages/**/package.json} : Node version 22+ with Volta pinned to 22.18.0

Applied to files:

  • examples/todo-with-auth0/packages/backend/package.json
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/packages/backend/**/schema.graphql : Backend must generate `schema.graphql` for the admin package to consume for code generation

Applied to files:

  • examples/todo-with-auth0/packages/backend/package.json
🧬 Code graph analysis (17)
examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date.ts (1)
examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date.ts (2)
examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date.ts (1)
  • DateScalar (16-16)
examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/uuid.ts (1)
examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date-time.ts (1)
examples/todo-with-auth0/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json-object.ts (1)
examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date.ts (1)
examples/todo-with-auth0/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
packages/project-builder-server/src/compiler/backend/fastify.ts (1)
packages/fastify-generators/src/generators/pothos/pothos-scalar/pothos-scalar.generator.ts (1)
  • pothosScalarGenerator (117-175)
packages/fastify-generators/src/generators/pothos/pothos-scalar/pothos-scalar.generator.ts (1)
packages/fastify-generators/src/constants/fastify-packages.ts (1)
  • FASTIFY_PACKAGES (1-89)
examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json-object.ts (1)
examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/uuid.ts (1)
examples/todo-with-auth0/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date-time.ts (2)
examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date-time.ts (1)
  • DateTimeScalar (20-24)
examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json.ts (2)
examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json.ts (1)
  • JSONScalar (22-22)
examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json.ts (1)
examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json.ts (1)
examples/todo-with-auth0/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json-object.ts (1)
examples/todo-with-auth0/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date-time.ts (2)
examples/blog-with-auth/packages/backend/baseplate/generated/src/modules/graphql/scalars/date-time.ts (1)
  • DateTimeScalar (20-24)
examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/uuid.ts (2)
examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/uuid.ts (1)
  • UuidScalar (16-16)
examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts (1)
  • builder (26-75)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Lint Examples (todo-with-auth0)
  • GitHub Check: Verify Sync (todo-with-auth0)
  • GitHub Check: Verify Sync (blog-with-auth)
  • GitHub Check: Test E2E
  • GitHub Check: Lint
  • GitHub Check: test
🔇 Additional comments (33)
.claude/settings.json (1)

17-18: Env override looks good.

Setting CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR helps keep tooling rooted correctly; no further changes needed.

examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/date-time.ts (2)

1-1: Excellent migration to a well-maintained library.

Replacing the custom DateTime scalar implementation with graphql-scalars follows best practices for using well-known libraries over custom implementations for common functionality.

Also applies to: 20-24


5-19: Keep existing JSDoc: it correctly describes DateTimeResolver behavior. DateTimeResolver enforces RFC 3339 formatting, normalizes all offsets to UTC, and serializes output in UTC.

examples/todo-with-auth0/packages/backend/src/plugins/graphql/builder.ts (1)

36-40: LGTM! JSON/JSONObject scalar types properly defined.

The scalar type definitions are appropriate:

  • JSON uses unknown for maximum flexibility with arbitrary JSON values
  • JSONObject uses Record<string, unknown> to enforce object structure
examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date.ts (1)

1-16: Excellent migration to graphql-scalars.

The replacement of custom Date scalar logic with DateResolver simplifies the codebase and delegates parsing/serialization to a well-maintained library. The JSDoc clearly documents the RFC 3339 format and UTC normalization behavior.

examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/date-time.ts (1)

1-24: LGTM! Clean DateTime scalar migration.

The implementation correctly uses DateTimeResolver from graphql-scalars, and the JSDoc examples effectively illustrate timezone handling (both UTC and offset formats).

examples/todo-with-auth0/packages/web/src/route-tree.gen.ts (1)

11-77: Auto-generated formatting changes.

These are punctuation-only changes (semicolon removal) in a TanStack Router generated file. No functional impact.

examples/todo-with-auth0/packages/admin/src/route-tree.gen.ts (1)

11-326: Auto-generated formatting changes.

Consistent with the web package's route tree, these are punctuation-only changes (semicolon removal) from the TanStack Router generator. No functional impact.

packages/fastify-generators/src/writers/pothos/scalars.ts (1)

59-63: LGTM! Consistent scalar definition.

The jsonObject scalar is properly added to INBUILT_POTHOS_SCALARS with structure and typing consistent with other scalar definitions like json and uuid.

examples/blog-with-auth/packages/backend/baseplate/file-id-map.json (1)

57-58: LGTM! Scalar mappings correctly added.

The file-id mappings for json and json-object scalars follow the established pattern and correctly point to the corresponding source files.

examples/todo-with-auth0/packages/backend/baseplate/file-id-map.json (1)

78-79: LGTM!

The JSON and JSONObject scalar mappings follow the established pattern and are correctly placed within the pothos-scalar namespace alongside the other scalar types.

examples/todo-with-auth0/packages/backend/src/modules/graphql/index.ts (1)

6-7: LGTM!

The scalar imports follow the established pattern and correctly use .js extensions as required by the coding guidelines for Node 16 module resolution.

examples/blog-with-auth/packages/backend/src/modules/graphql/index.ts (1)

6-7: LGTM!

The scalar imports are consistent with the todo-with-auth0 example and follow all coding guidelines.

examples/blog-with-auth/packages/backend/package.json (1)

56-56: LGTM!

The addition of graphql-scalars aligns with the migration strategy documented in the changeset. The pinned version ensures consistency across environments.

packages/fastify-generators/src/writers/prisma-schema/fields.ts (1)

91-91: LGTM!

The jsonObject field type correctly maps to Prisma's Json type, mirroring the existing json field. Both GraphQL scalar types (JSON and JSONObject) share the same database representation while enforcing different validation rules at the GraphQL layer.

packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json-object.ts (1)

1-28: LGTM!

The template is well-structured with excellent JSDoc documentation that clearly explains:

  • What JSONObject accepts (objects only)
  • What it rejects (arrays, primitives, null)
  • When to use JSONObject vs JSON scalar

The @ts-nocheck directive on Line 1 is acceptable for template files where placeholders like %pothosImports are replaced during code generation.

examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json-object.ts (1)

1-27: LGTM!

The implementation correctly follows the template pattern and adheres to coding guidelines:

  • Uses @src/ path alias as specified
  • Includes .js extension for Node 16 module resolution
  • Comprehensive JSDoc documentation
  • Properly imports and registers the JSONObjectResolver from graphql-scalars

The scalar is correctly typed in the builder (as shown in the relevant code snippet from builder.ts) as Record<string, unknown> for both Input and Output.

examples/todo-with-auth0/packages/backend/schema.graphql (3)

78-86: LGTM! Scalar documentation improved.

The documentation updates for Date and DateTime scalars now correctly reference RFC 3339 format specifications, providing clearer guidance for API consumers.


157-165: LGTM! New JSON scalars added with clear documentation.

The JSON and JSONObject scalar additions are well-documented and follow the same pattern as existing scalars. The distinction between JSON (any valid JSON) and JSONObject (objects only) is clearly explained.


445-447: LGTM! UUID documentation enhanced with reference link.

The UUID scalar documentation now includes a Wikipedia reference for additional context.

examples/blog-with-auth/packages/backend/src/plugins/graphql/builder.ts (1)

36-40: LGTM! JSON scalar type definitions are appropriate.

The type definitions correctly represent:

  • JSON: Uses unknown for maximum flexibility with any valid JSON value
  • JSONObject: Uses Record<string, unknown> to enforce object-only structure

These align well with the corresponding graphql-scalars resolvers.

examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json-object.ts (1)

1-27: Add explicit return type annotation.

The exported constant JSONObjectScalar should have an explicit return type annotation to comply with the coding guidelines.

As per coding guidelines.

Apply this diff:

-export const JSONObjectScalar = builder.addScalarType(
+export const JSONObjectScalar: ReturnType<typeof builder.addScalarType> = builder.addScalarType(
   'JSONObject',
   JSONObjectResolver,
   {},
 );

Likely an incorrect or invalid review comment.

packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/json.ts (1)

1-23: Add explicit return type annotation to template.

As a generator template, this should include the return type annotation to ensure all generated code follows the project's coding guidelines.

As per coding guidelines.

Apply this diff:

-export const JSONScalar = builder.addScalarType('JSON', JSONResolver, {});
+export const JSONScalar: ReturnType<typeof builder.addScalarType> = builder.addScalarType('JSON', JSONResolver, {});

Likely an incorrect or invalid review comment.

packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date.ts (1)

1-17: Add explicit return type annotation to template.

As a generator template, this should include the return type annotation to ensure all generated code follows the project's coding guidelines.

As per coding guidelines.

Apply this diff:

-export const DateScalar = builder.addScalarType('Date', DateResolver, {});
+export const DateScalar: ReturnType<typeof builder.addScalarType> = builder.addScalarType('Date', DateResolver, {});

Likely an incorrect or invalid review comment.

examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/json.ts (1)

1-22: Add explicit return type annotation.

The exported constant JSONScalar should have an explicit return type annotation to comply with the coding guidelines for this project.

As per coding guidelines, which state: "Always specify explicit return types for all functions" and "If a particular interface or type is not exported in a TypeScript file, modify the file to export it."

Apply this diff to add the return type:

-export const JSONScalar = builder.addScalarType('JSON', JSONResolver, {});
+export const JSONScalar: ReturnType<typeof builder.addScalarType> = builder.addScalarType('JSON', JSONResolver, {});

Alternatively, if a more specific scalar type is available from @pothos/core, use that instead of ReturnType.

Likely an incorrect or invalid review comment.

examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/json.ts (1)

1-22: Add explicit return type annotation.

The exported constant JSONScalar should have an explicit return type annotation to comply with the coding guidelines for this project.

As per coding guidelines.

Apply this diff:

-export const JSONScalar = builder.addScalarType('JSON', JSONResolver, {});
+export const JSONScalar: ReturnType<typeof builder.addScalarType> = builder.addScalarType('JSON', JSONResolver, {});

Likely an incorrect or invalid review comment.

packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/uuid.ts (1)

1-17: Add explicit return type annotation to template.

Since this is a generator template, the missing return type annotation will be propagated to all generated code. Adding it here ensures all generated scalar files comply with the project's coding guidelines.

As per coding guidelines.

Apply this diff:

-export const UuidScalar = builder.addScalarType('Uuid', UUIDResolver, {});
+export const UuidScalar: ReturnType<typeof builder.addScalarType> = builder.addScalarType('Uuid', UUIDResolver, {});

Likely an incorrect or invalid review comment.

examples/todo-with-auth0/packages/backend/src/modules/graphql/scalars/uuid.ts (1)

1-16: LGTM! Clean migration to graphql-scalars.

The implementation correctly delegates UUID validation and serialization to the battle-tested UUIDResolver from graphql-scalars, replacing custom validation logic. The JSDoc is comprehensive and includes clear examples.

packages/fastify-generators/src/generators/pothos/pothos-scalar/templates/module/scalars/date-time.ts (1)

1-25: LGTM! Consistent template migration.

The template correctly migrates to DateTimeResolver from graphql-scalars. The JSDoc helpfully documents timezone handling behavior, which is important for DateTime scalars.

examples/blog-with-auth/packages/backend/src/modules/graphql/scalars/uuid.ts (1)

1-16: LGTM! Consistent implementation across examples.

This implementation is identical to the todo-with-auth0 example, ensuring consistency across the codebase. The migration to graphql-scalars is clean and correct.

packages/fastify-generators/src/generators/pothos/pothos-scalar/extractor.json (1)

32-57: JSON scalar template files verified
Both json.ts and json-object.ts exist under templates/module/scalars, matching the extractor configuration entries.

packages/fastify-generators/src/generators/pothos/pothos-scalar/pothos-scalar.generator.ts (2)

139-139: Add explicit return type to run function.

The run function is missing an explicit return type annotation, which violates the coding guidelines requirement to "Always specify explicit return types for all functions."

Based on the return statement at lines 156-171, add the following return type:

-      run({ appModule, paths, pothosConfig, pothosImports, typescriptFile }) {
+      run({ appModule, paths, pothosConfig, pothosImports, typescriptFile }): { build: (builder: any) => Promise<void> } {
⛔ Skipped due to learnings
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/packages/{admin,backend}/src/**/*.{ts,tsx} : Always specify explicit return types for all functions
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:02:31.412Z
Learning: Applies to examples/blog-with-auth/packages/**/src/**/*.{ts,tsx} : Always specify explicit return types for all functions

49-106: ScalarFieldType already covers ‘json’ and ‘jsonObject’. Both literals appear in SCALAR_FIELD_TYPES, so no update is required.

Comment on lines +81 to +106
json: {
name: 'JSON',
scalar: 'json',
templatePath: 'json',
export: 'JSONScalar',
inputType: 'unknown',
outputType: 'unknown',
dependencies: {
'graphql-scalars': FASTIFY_PACKAGES['graphql-scalars'],
},
devDependencies: {},
path: 'json.ts',
},
jsonObject: {
name: 'JSONObject',
scalar: 'jsonObject',
templatePath: 'jsonObject',
export: 'JSONObjectScalar',
inputType: 'Record<string, unknown>',
outputType: 'Record<string, unknown>',
dependencies: {
'graphql-scalars': FASTIFY_PACKAGES['graphql-scalars'],
},
devDependencies: {},
path: 'json-object.ts',
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Fix template key mismatch for jsonObject.

The templatePath for jsonObject uses camelCase 'jsonObject' (line 97), but the extractor.json defines the template key as kebab-case 'json-object' (extractor.json line 45). This mismatch will cause a runtime error when the generator tries to access the template at lines 161-163.

Apply this diff to fix the template key:

   jsonObject: {
     name: 'JSONObject',
     scalar: 'jsonObject',
-    templatePath: 'jsonObject',
+    templatePath: 'json-object',
     export: 'JSONObjectScalar',
     inputType: 'Record<string, unknown>',
     outputType: 'Record<string, unknown>',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
json: {
name: 'JSON',
scalar: 'json',
templatePath: 'json',
export: 'JSONScalar',
inputType: 'unknown',
outputType: 'unknown',
dependencies: {
'graphql-scalars': FASTIFY_PACKAGES['graphql-scalars'],
},
devDependencies: {},
path: 'json.ts',
},
jsonObject: {
name: 'JSONObject',
scalar: 'jsonObject',
templatePath: 'jsonObject',
export: 'JSONObjectScalar',
inputType: 'Record<string, unknown>',
outputType: 'Record<string, unknown>',
dependencies: {
'graphql-scalars': FASTIFY_PACKAGES['graphql-scalars'],
},
devDependencies: {},
path: 'json-object.ts',
},
json: {
name: 'JSON',
scalar: 'json',
templatePath: 'json',
export: 'JSONScalar',
inputType: 'unknown',
outputType: 'unknown',
dependencies: {
'graphql-scalars': FASTIFY_PACKAGES['graphql-scalars'],
},
devDependencies: {},
path: 'json.ts',
},
jsonObject: {
name: 'JSONObject',
scalar: 'jsonObject',
templatePath: 'json-object',
export: 'JSONObjectScalar',
inputType: 'Record<string, unknown>',
outputType: 'Record<string, unknown>',
dependencies: {
'graphql-scalars': FASTIFY_PACKAGES['graphql-scalars'],
},
devDependencies: {},
path: 'json-object.ts',
},
🤖 Prompt for AI Agents
In
packages/fastify-generators/src/generators/pothos/pothos-scalar/pothos-scalar.generator.ts
around lines 81 to 106, the jsonObject entry uses templatePath: 'jsonObject'
which does not match the extractor.json template key 'json-object'; update the
jsonObject.templatePath value to 'json-object' so the generator can find the
correct template, then run the generator/tests to verify no template-not-found
errors.

@kingston kingston merged commit 852c3a5 into main Oct 10, 2025
17 checks passed
@kingston kingston deleted the kingston/eng-813-replace-custom-graphql-scalars-with-graphql-scalars-package branch October 10, 2025 12:15
@github-actions github-actions Bot mentioned this pull request Oct 10, 2025
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.

1 participant