Commit 9732147
committed
Address PR review feedback on GraphQL::Schema::Type helpers
- `source_type`: restore `&.` safe navigation since `@object_runtime_metadata`
can be nil for non-object types (scalars, enums); return `nil` instead of
`self` for non-derived types; update `search_index_definitions` to branch on
`source_type` truthy rather than `indexed_aggregation?`, and update comment
to describe the general case with indexed aggregation as a prime example
- `subtypes`: return a `Set` instead of `Array`; inline `subtypes` in
`non_subtypes_in_shared_index` rather than caching in a local variable
- Tests: use `before(:context)` shared schema in `#source_type` group; add
scalar and enum nil cases; use `contain_exactly` for precise set assertions;
consolidate `not_to include` calls; add coverage for `t == self` guard
Generated with Claude Code1 parent 7857f68 commit 9732147
3 files changed
Lines changed: 48 additions & 47 deletions
File tree
- elasticgraph-graphql
- lib/elastic_graph/graphql/schema
- sig/elastic_graph/graphql/schema
- spec/unit/elastic_graph/graphql/schema
Lines changed: 14 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
130 | | - | |
| 132 | + | |
131 | 133 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 134 | + | |
138 | 135 | | |
139 | 136 | | |
140 | 137 | | |
| |||
145 | 142 | | |
146 | 143 | | |
147 | 144 | | |
148 | | - | |
149 | | - | |
| 145 | + | |
150 | 146 | | |
151 | 147 | | |
152 | | - | |
| 148 | + | |
153 | 149 | | |
154 | | - | |
155 | 150 | | |
156 | 151 | | |
157 | 152 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
Lines changed: 32 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | | - | |
| 607 | + | |
608 | 608 | | |
609 | | - | |
| 609 | + | |
610 | 610 | | |
611 | 611 | | |
612 | | - | |
| 612 | + | |
613 | 613 | | |
614 | | - | |
| 614 | + | |
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
| |||
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
762 | | - | |
763 | | - | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
764 | 771 | | |
765 | 772 | | |
| 773 | + | |
766 | 774 | | |
767 | 775 | | |
768 | 776 | | |
| 777 | + | |
769 | 778 | | |
770 | | - | |
771 | | - | |
| 779 | + | |
| 780 | + | |
772 | 781 | | |
773 | 782 | | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
781 | 786 | | |
782 | | - | |
783 | | - | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
784 | 793 | | |
785 | 794 | | |
786 | 795 | | |
| |||
821 | 830 | | |
822 | 831 | | |
823 | 832 | | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
| 833 | + | |
| 834 | + | |
831 | 835 | | |
832 | 836 | | |
833 | | - | |
834 | | - | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
835 | 841 | | |
836 | 842 | | |
837 | 843 | | |
| |||
0 commit comments