Skip to content

Conversation

@byme8
Copy link
Owner

@byme8 byme8 commented Aug 20, 2025

Summary

  • Fixed analyzer issue where nameof() expressions were incorrectly rejected as query names
  • Modified ResolveName method to accept both string literals and nameof() expressions
  • Updated error message to reflect that both literals and nameof are accepted

Changes

  • GraphQLLambdaLikeContextResolver.cs: Enhanced ResolveName method to handle nameof() expressions
  • Descriptors.cs: Updated error message to mention both literals and nameof expressions are allowed
  • QueryTests.cs: Added test for nameof() support and test ensuring other expressions are still rejected

Test plan

  • Build succeeds without errors
  • New test SupportsNameofQueryName passes, verifying nameof(Execute) works
  • New test RejectsNonLiteralNonNameofQueryName passes, ensuring other expressions are still rejected
  • All existing QueryTests pass (38 passed, 1 skipped)
  • No regressions in analyzer behavior

🤖 Generated with Claude Code

byme8 and others added 2 commits August 21, 2025 01:54
- Modified ResolveName method to accept both string literals and nameof() expressions
- Updated error message to reflect that both literals and nameof are accepted
- Added test to verify nameof() expressions work correctly
- Added test to ensure non-literal/non-nameof expressions are still rejected

This resolves the analyzer issue where nameof(methodName) was incorrectly
flagged as "GraphQL query name should be literal"

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Added onlyFirstCall parameter to VerifyServiceIsRunning to prevent hanging in tests
- Updated PersistentQueryTest to use the new parameter for faster test execution

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@byme8 byme8 merged commit ca96169 into main Aug 20, 2025
@byme8 byme8 deleted the feature/nameof branch October 14, 2025 12:06
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.

2 participants