Commit 701ea8d
feat: add composite type support for field resolvers (#1341)
This PR improves the existing functionality for field resolvers.
Currently field resolvers do not support returning any form of composite
types (interfaces and unions). This feature will be provided in this PR.
The planner will now determine the correct selection set and identify,
whether the field selections are part of an inline fragment. The calling
logic will always inline all fragments provided to the datasource,
therefore we do not need to handle fragments and spreads.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Resolver-driven execution planning with nested field-resolver support
and enhanced composite-type handling; new GraphQL fields/types (product
mascotRecommendation/stockStatus/productDetails, category
mascot/categoryStatus/metrics, TestContainer/TestDetails,
animal/owner/breed data) and matching RPCs.
* **Tests**
* Large expansion of test coverage for nested resolvers,
composite/interface/union scenarios, federation/entity lookups,
execution plan generation, stack utilities, lookups, mappings, and
nullable-field cases.
* **Chores**
* Updated mock services, RPC mappings/protos, test helpers, and internal
utilities to support the above.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Checklist
- [ ] I have discussed my proposed changes in an issue and have received
approval to proceed.
- [ ] I have followed the coding standards of the project.
- [ ] Tests or benchmarks have been added or updated.
<!--
Please add any additional information or context regarding your changes
here.
-->
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>1 parent 37152c1 commit 701ea8d
File tree
28 files changed
+13993
-5214
lines changed- v2/pkg
- astvisitor
- ast
- engine/datasource/grpc_datasource
- grpctest
- mapping
- productv1
- testdata
28 files changed
+13993
-5214
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
215 | 227 | | |
216 | 228 | | |
217 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4021 | 4021 | | |
4022 | 4022 | | |
4023 | 4023 | | |
| 4024 | + | |
4024 | 4025 | | |
4025 | 4026 | | |
4026 | 4027 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | | - | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
608 | 610 | | |
609 | 611 | | |
610 | 612 | | |
| |||
625 | 627 | | |
626 | 628 | | |
627 | 629 | | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
632 | 634 | | |
633 | 635 | | |
634 | 636 | | |
| |||
736 | 738 | | |
737 | 739 | | |
738 | 740 | | |
739 | | - | |
| 741 | + | |
740 | 742 | | |
741 | 743 | | |
742 | 744 | | |
| |||
835 | 837 | | |
836 | 838 | | |
837 | 839 | | |
838 | | - | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
839 | 859 | | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
840 | 867 | | |
841 | 868 | | |
842 | 869 | | |
| |||
0 commit comments