Skip to content

Conversation

@yyyyaaa
Copy link
Contributor

@yyyyaaa yyyyaaa commented Jan 19, 2026

Problem

The React Query hooks generator was producing delete mutations with a hardcoded deletedId field, but our backend convention switched to use type-specific field names. I think this is very recent?

deleted{EntityName}NodeId

Before (broken)

deleteUser(input: $input) { deletedId }

After (correct)

deleteUser(input: $input) { deletedUserNodeId }

Solution

  • Added getDeletedNodeIdFieldName() helper that infers the correct field name from the TypeRegistry (schema introspection), with fallback to PostGraphile naming convention
  • Updated buildDeleteMutationAST() and generateDeleteMutationHook() to use the inferred field name
  • Passed TypeRegistry from the codegen orchestrator to mutation generators

@yyyyaaa yyyyaaa requested a review from pyramation January 19, 2026 09:39
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