Proposal to solve dependency in GQL schema between QuoteGQL and WishlistGQL #413
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Based on the uid changes, new/existing mutations in the future will be leveraging the EnteredOptionInput type.
Based on this architecture AddProductsToCart the type EnteredOptionInput is inferred to be in QuoteGQL module.
The same type is being used in WishlistGQL Wishlist for its mutations. This creates a dependency between WishlistGQL and QuoteGQL.
Solution
There a couple of ways to fix this.
Solution 1. Move the
EnteredOptionInput
to the GraphQL framework module, which will avoid cross dependencies across modules except for the framework module. (Added in the document)Solution 2. Rename field names specific to the modules, possibly
WishlistEnteredOptionInput
andCartItemEnteredOptionInput
and have the type on respective modules. This introduces a very minimum level of duplication but the provides the flexibility to update input types in the future. Flexibility plays a key role here, since modifying input types impacts the mutations in which the those types are being used in.Solution 3. Create a new module to move this type to. This might be an overkill for just a type.
Requested Reviewers
@paliarush @akaplya @DrewML