Prefer Inferred Types over unknown types While Merging When Two Types Have Similar Fields
Issue Description
When merging types in the generated GraphQL config, if two types have exactly similar fields but differ only by unknown (empty) types, the known type should be given preference. Enable this behavior, configurable via a flag.
Example:
Given the following types:
type A {
brand: String
discountApplicable: Boolean
id: String
imported: Boolean
minimumRequiredAge: Int
name: String
pharmaceuticalInfo: Empty
primarySubcategoryId: String
}
type B {
brand: String
discountApplicable: Boolean
id: String
imported: Boolean
minimumRequiredAge: Int
name: String
pharmaceuticalInfo: Empty
primarySubcategoryId: Empty
}
Current Behavior:
- The types
AandBare treated as distinct types due to the presence ofEmptyfields.
Expected Behavior:
- Types
AandBshould be merged, giving preference to known types overEmpty.
Requested Feature:
- Add a flag to enable inferring types while merging, with preference for known types over
Empty. - The feature should be configurable via a flag in the configuration file.
/bounty 75$
💎 $75 bounty • Tailcall Inc.
Steps to solve:
- Start working: Comment
/attempt #2560with your implementation plan - Submit work: Create a pull request including
/claim #2560in the PR body to claim the bounty - Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts
🙏 Thank you for contributing to tailcallhq/tailcall! 🧐 Checkout our guidelines before you get started. 💵 More about our bounty program.
| Attempt | Started (GMT+0) | Solution |
|---|---|---|
| 🔴 @ssddOnTop | Jul 28, 2024, 12:26:54 PM | WIP |
| 🟢 @laststylebender14 | #2567 |
/attempt #2560
| Algora profile | Completed bounties | Tech | Active attempts | Options |
|---|---|---|---|---|
| @ssddOnTop | 67 tailcallhq bounties | Rust, Java, C & more |
Cancel attempt |
💡 @laststylebender14 submitted a pull request that claims the bounty. You can visit your bounty board to reward.
@ssddOnTop: Reminder that in 1 days the bounty will become up for grabs, so please submit a pull request before then 🙏
The bounty is up for grabs! Everyone is welcome to /attempt #2560 🙌