Skip to content

Comments

Add support for literal boolean and string types#214

Merged
captbaritone merged 1 commit intomainfrom
bool-literal
Jan 26, 2026
Merged

Add support for literal boolean and string types#214
captbaritone merged 1 commit intomainfrom
bool-literal

Conversation

@captbaritone
Copy link
Owner

Summary

  • Literal true/false types now infer to Boolean in output positions (field return types)
  • Literal string types (e.g., "hello") now infer to String in output positions
  • Literal types in input positions (arguments, input type fields) produce a helpful error explaining that GraphQL cannot enforce specific literal values
  • Numeric literal types (e.g., 42, 3.14) produce a specific error about being ambiguous between Int and Float, similar to the number type

Test plan

  • Added tests for literal boolean/string in output positions (valid)
  • Added tests for literal types in input positions - arguments and input type fields (invalid)
  • Added test for numeric literal types (invalid with specific error)
  • All tests pass

🤖 Generated with Claude Code

- Literal `true`/`false` types now infer to `Boolean` in output positions
- Literal string types (e.g., `"hello"`) now infer to `String` in output positions
- Literal types in input positions (arguments, input type fields) produce a
  helpful error explaining that GraphQL cannot enforce specific literal values
- Numeric literal types (e.g., `42`, `3.14`) produce a specific error about
  being ambiguous between Int and Float, similar to the `number` type

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@netlify
Copy link

netlify bot commented Jan 26, 2026

Deploy Preview for grats ready!

Name Link
🔨 Latest commit 5677503
🔍 Latest deploy log https://app.netlify.com/projects/grats/deploys/6976ecc44b5cca00085b1085
😎 Deploy Preview https://deploy-preview-214--grats.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@captbaritone captbaritone merged commit d40191b into main Jan 26, 2026
14 checks passed
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