Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Post-Processing Deduplication for Deep GraphQL Queries/mutations #942

Open
1 of 2 tasks
jgroom33 opened this issue Feb 22, 2025 · 0 comments
Open
1 of 2 tasks
Labels
pending-triage Issues that need further discussion to determine

Comments

@jgroom33
Copy link

Describe the feature you'd like to request

Problem
The current amplify-codegen generates GraphQL queries, mutations, and subscriptions with a uniform depth (configurable via --maxDepth), but it doesn’t address redundant data in deeply interrelated schemas.

It may be useful to generate queries with a max depth of 4, but duplicated data from a closely related object may be generated unnecessarily.

Goal
Provide a mechanism to prune any duplicated query branches.

Describe the solution you'd like

Add a flag --deduplicate

When used with --maxDepth it could be possible to generate queries that can traverse the entire graph with no duplication.

Describe alternatives you've considered

Write custom queries with varying custom depths for each related object.

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • ⚠️ This feature might incur a breaking change
@jgroom33 jgroom33 added the pending-triage Issues that need further discussion to determine label Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-triage Issues that need further discussion to determine
Projects
None yet
Development

No branches or pull requests

1 participant