@@ -31,7 +31,7 @@ control‑flow. For example:
3131if .request.headers."x-feature-toggle" == "beta" {
3232 "https://beta.example.com/graphql"
3333} else {
34- .original_url
34+ .default
3535}
3636```
3737
@@ -89,13 +89,29 @@ While not a full object, the special variable `.timestamp` yields the current UN
8989header manipulation guide demonstrates using ` .timestamp ` to add a ` X‑Request‑Time ` header. This is
9090useful for debugging and tracing requests.
9191
92- ### ` .original_url `
92+ ### ` .default `
9393
9494This variable is only available in [ dynamic routing expressions] ( ./override_subgraph_urls ) . It holds
9595the default URL for the current subgraph, as declared in your supergraph schema. Because the
96- expression must return a URL, you should always provide a fallback using ` .original_url ` so that
97- requests are routed somewhere when no condition matches. The configuration reference emphasises this
98- by showing a pattern where the expression returns ` .original_url ` in the ` else ` branch.
96+ expression must return a URL, you should always provide a fallback using ` .default ` so that requests
97+ are routed somewhere when no condition matches. The configuration reference emphasises this by
98+ showing a pattern where the expression returns ` .default ` in the ` else ` branch.
99+
100+ ### ` .default `
101+
102+ This variable is available in [ dynamic routing expressions] ( ./override_subgraph_urls ) and
103+ [ traffic shaping expressions] ( ./traffic_shaping ) . It holds the default value for the context in
104+ which it is used:
105+
106+ - In ** dynamic routing** , it holds the default URL for the current subgraph, as declared in your
107+ supergraph schema.
108+ - In ** traffic shaping** , it holds the default timeout value set at the global level (available for
109+ subgraph overrides).
110+
111+ When writing expressions with conditional logic (like ` if ` statements), you must ensure a value is
112+ returned for all paths. You may return any valid value, but ` .default ` is commonly used as a
113+ fallback. This allows you to override the configuration for specific conditions while maintaining
114+ the originally assigned value for all other cases.
99115
100116## Available functions
101117
0 commit comments