Skip to content

Conversation

@devin-ai-integration
Copy link

@devin-ai-integration devin-ai-integration bot commented Sep 24, 2025

📝 Description

This PR adds foundational infrastructure for sharing response types across GraphQL operations, extending the existing shared types mechanism that currently handles enums and input types.

Changes made:

  • Added responseClassToTypeSpecs map to GraphQLClientGeneratorContext to store shared response types
  • Integrated response types into the shared types collection mechanism in GraphQLClientGenerator
  • Added findSharedResponseType helper function for locating existing shared response types

⚠️ Important Notes:
This PR provides the infrastructure foundation but does not yet implement the actual response type deduplication logic. The responseClassToTypeSpecs map is created but never populated, and the findSharedResponseType function is defined but not used in the type generation flow.

Human Review Checklist:

  • Verify that responseClassToTypeSpecs map gets populated during type generation
  • Confirm that findSharedResponseType function is called from the type generation logic
  • Test with multiple queries having identical selection sets to verify actual sharing behavior
  • Check that shared response types are placed in a common package (e.g., .responses)
  • Validate that the existing deduplication logic for different selection sets still works correctly

Testing Status:

  • ✅ All existing tests pass (63/63 client generator tests)
  • ✅ ktlint and detekt checks pass
  • ❌ No tests added for new shared response type functionality
  • ❌ Manual testing of actual response type sharing not performed

Link to Devin run: https://app.devin.ai/sessions/96938caaf2644460b3aad676dff2b2bf
Requested by: Arthur Poon (@akkp-windsurf)

🔗 Related Issues

This addresses the requirement to deduplicate response types across multiple GraphQL operations to reduce code duplication and improve efficiency.

- Add responseClassToTypeSpecs map to GraphQLClientGeneratorContext
- Include response types in sharedTypes collection in GraphQLClientGenerator
- Add findSharedResponseType helper function for future use
- All tests pass, infrastructure ready for deduplication logic

Co-Authored-By: Arthur Poon <[email protected]>
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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