Commit 445fa89
Prototype: fetchable: false field option to exclude fields from _source
Adds a new `fetchable: false` option for field definitions that allows fields
to remain filterable, sortable, groupable, and aggregatable while being excluded
from the GraphQL output type and from `_source` in the datastore mapping.
Changes:
- Field struct: new `:fetchable` member with `fetchable?` predicate (defaults true)
- fields_sdl: filters out non-fetchable fields from output type SDL
- Index#mappings: emits `_source.excludes` for non-fetchable field paths
- TypeWithSubfields#non_fetchable_field_paths: collects paths using
indexing_fields_by_name_in_index to avoid interface/union recursion cycles
- to_filter_field: resets fetchable to nil so filter fields still appear in
filter input types
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 42bf7fb commit 445fa89
3 files changed
Lines changed: 54 additions & 3 deletions
File tree
- elasticgraph-schema_definition/lib/elastic_graph/schema_definition
- indexing
- schema_elements
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
327 | 337 | | |
328 | 338 | | |
329 | 339 | | |
| |||
Lines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
743 | 744 | | |
744 | 745 | | |
745 | 746 | | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
746 | 757 | | |
747 | 758 | | |
748 | 759 | | |
| |||
892 | 903 | | |
893 | 904 | | |
894 | 905 | | |
895 | | - | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
896 | 910 | | |
897 | 911 | | |
898 | 912 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
140 | 143 | | |
141 | 144 | | |
142 | 145 | | |
| |||
482 | 485 | | |
483 | 486 | | |
484 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
485 | 511 | | |
486 | 512 | | |
487 | 513 | | |
| |||
531 | 557 | | |
532 | 558 | | |
533 | 559 | | |
| 560 | + | |
534 | 561 | | |
535 | 562 | | |
536 | 563 | | |
| |||
0 commit comments