You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**`visibility_profiles:`**, an array of [visibility profiles](./visibility.md) that the supergraph responds to.
64
60
65
-
-**`description_merger:`**, a [value merger function](#value-merger-functions) for merging element description strings from across locations.
66
-
67
-
-**`deprecation_merger:`**, a [value merger function](#value-merger-functions) for merging element deprecation strings from across locations.
68
-
69
-
-**`default_value_merger:`**, a [value merger function](#value-merger-functions) for merging argument default values from across locations.
70
-
71
-
-**`directive_kwarg_merger:`**, a [value merger function](#value-merger-functions) for merging directive keyword arguments from across locations.
72
-
73
61
-**`root_entrypoints:`**, a hash of root field names mapped to their entrypoint locations, see [overlapping root fields](#overlapping-root-fields) below.
74
62
75
-
####Value merger functions
63
+
### Value mergers
76
64
77
-
Static data values such as element descriptions and directive arguments must also merge across locations. By default, the first non-null value encountered for a given element attribute is used. A value merger function may customize this process by selecting a different value or computing a new one:
65
+
Static data values such as element descriptions and directive arguments must also merge across locations. By default, the first non-null value encountered for a given element property is used. Value merger methods can be customized by defining them on your own `Client` class:
# return a merged element description string from across locations...
71
+
values_by_location.each_value.join("\n")
72
+
end
73
+
74
+
defmerge_deprecations(values_by_location, info)
75
+
# return a merged element deprecation string from across locations...
76
+
end
77
+
78
+
defmerge_default_values(values_by_location, info)
79
+
# return a merged argument default value from across locations...
80
+
end
81
+
82
+
defmerge_kwargs(values_by_location, info)
83
+
# return a merged directive keyword argument from across locations...
84
+
end
85
+
end
86
+
87
+
client =MyClient.new(locations: ...)
90
88
```
91
89
92
-
A merger function receives`values_by_location` and `info` arguments; these provide possible values keyed by location and info about where in the schema these values were encountered:
90
+
All merge functions receive`values_by_location` and `info` arguments; these provide possible values keyed by location and info about where in the schema these values were encountered. For example:
93
91
94
92
```ruby
95
93
values_by_location = {
96
-
"users" => "A fabulous data type.",
97
-
"products" => "An excellent data type.",
94
+
"users" => "A fabulous data type description.",
95
+
"products" => "An excellent data type description.",
0 commit comments