Commit cd6f827
authored
feat: send to subgraphs the "fetch_reasons" extension (#2160)
Subgraphs now can now receive the "fetch_reasons" extension that
lists subgraphs and reasons why fields marked with
@openfed__requireFetchReasons directive were requested.
Example of the request to subgraph:
{
"query": "{accounts {__typename ... on User {some {__typename id}}}}",
"extensions": {
"fetch_reasons": [
{
"typename": "User",
"field": "id",
"by_user": true,
"by_subgraphs": ["id-2"],
"is_requires": true
}, {
"typename": "User",
"field": "some",
"by_user": true
}, {
"typename": "Query",
"field": "accounts",
"by_user": true
}
]
}
}
This can be enabled via configuration of router:
engine:
enable_require_fetch_reasons: true
Disabled by default. Always ignored for introspection queries.1 parent 2254925 commit cd6f827
File tree
13 files changed
+5002
-16
lines changed- router-tests
- testenv
- testdata
- router
- core
- pkg/config
- testdata
13 files changed
+5002
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
356 | | - | |
| 355 | + | |
| 356 | + | |
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
835 | 871 | | |
836 | 872 | | |
837 | 873 | | |
| |||
0 commit comments