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

Data builders: only generate used fields #4472

Merged
merged 3 commits into from
Oct 21, 2022
Merged

Conversation

martinbonnin
Copy link
Contributor

This is a follow up of this slack discussion

One of the main motivations behind data builders was to reduce the amount of generated code and make sure it's not subject to exponential blowup.

Data builders generate code that is O(schemaSize) while test builders generate code that is O(sumOfResponseSizeOverAllOperations). In general this should be more predictable but if the schema is large, there is an upfront cost that make the data builders actually generate more code.

This pull request tracks field usages so that only fields that are used in operation are generated in builders.

@eduardb let me know what you think

@netlify
Copy link

netlify bot commented Oct 21, 2022

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit 40b8f48
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/63528aa4d655270009eac149

Copy link
Contributor

@BoD BoD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

…ollographql/apollo3/gradle/api/Service.kt

Co-authored-by: Benoit Lubek <[email protected]>
@martinbonnin martinbonnin merged commit 4552149 into main Oct 21, 2022
@martinbonnin martinbonnin deleted the only-generate-used-fields branch October 21, 2022 12:47
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