If non-empty, Inserts named paths into a template string. For example, if the template is ‘/api/{apiVersionPath}/pet/{petIdPath}’ and we have two named paths defined in named_paths, apiVersionPath and petIdPath, with extracted values ‘v2’ and ‘123’ respectively, the final resulting value will be ‘/api/v2/pet/123’ Use {PATH_NAME} as the interpolation notation (even repeated) regardless of the type of the provided value. If an undefined PATH_NAME is used in the template, this will nack during configuration. If this is empty, only the value of the first provider will be used as the resulting value.
Map of provider name to provider definition. The name will be used to insert the provider value in the provider_template.
providerTemplate
string
If non-empty, Inserts named providers into a template string. For example, if the provider_template is ‘/api/{apiVersionProvider}/pet/{petIdProvider}’ and we have two named providers defined in providers, apiVersionProvider and petIdProvider, with extracted values ‘v2’ and ‘123’ respectively, the final resulting value will be ‘/api/v2/pet/123’ Use {PROVIDER_NAME} as the interpolation notation (even repeated) regardless of the type of the provided value. If an undefined PROVIDER_NAME is used in the provider_template, this will nack during configuration. If this is empty, only the value of the first provider will be used as the resulting value.
The argument name to fetch. The argument value fetched will have a type from the schema that we validate in envoy. If the name is invalid, returns the zero-value primitive or null.
Optional: fetches the value in the argument selected at this key. If the key is invalid, returns the zero-value primitive or null.
GraphQLParentExtraction
Does not do type coercion, but instead if the type does not match the
expected primitive type we throw an error.
In the future we may add support for type coercion.
Fetches the value in the graphql parent at this key. The value will always be accepted since the parent object is not strongly-typed. If the key is invalid, returns null.
PARTIALLY IMPLEMENTED if empty, the value will be parsed as json and replace the entire previously-parsed json value –> this part is only needed for gRPC and thus not implemented yet.
if keys repeat, the latest one replaces any earlier values associated with that key. repeated list, rather than a map, to have ordering to allow for merge semantics within the data plane, for example: - gRPC input uses special empty string for input key to set entire body - gRPC wants to replace a certain field in parsed body from GraphQL arg.
RequestTemplate
Defines a configuration for generating outgoing requests for a resolver.
Use this attribute to set request headers to your REST service. It consists of a map of strings to value providers. The string key determines the name of the resulting header, the value provided will be the value. at least need “:method” and “:path”.
Use this attribute to set query parameters to your REST service. It consists of a map of strings to value providers. The string key determines the name of the query param, the provided value will be the value. This value is appended to any value set to the :path header in headers. Interpolation is done in envoy rather than the control plane to prevent escaped character issues. Additionally, we may be providing values not known until the request is being executed (e.g., graphql parent info).
In cases where the data to populate the graphql type is not in the root object of the result, use result root to specify the path of the response we should use as the root. If {“a”: {“b”: [1,2,3]}} is the response from the api, setting resultroot as a.b will pass on [1,2,3] to the execution engine rather than the whole api response.
Example: type Query { getSimple: Simple } type Simple { name String address String } if we do getsimple and the response we get back from the upstream is {"data": { "people": { "name": "John Doe", "details": { "address": "123 Turnip Rd" } } } } the following response transform would let the graphql execution engine correctly marshal the upstream resposne into the expected graphql response: responseTransform: result_root: segments: - key: data - key: people setters: address: segments: - key: details - key: addressyaml.
Responds asynchronously after delay_ms. Only one of asyncResponse, syncResponse, or errorResponse can be set.
errorResponse
string
Only one of errorResponse, syncResponse, or asyncResponse can be set.
AsyncResponse
"response": string"delayMs": int
Field
Type
Description
response
string
delayMs
int
AbstractTypeResolver
NOT IMPLEMENTED
Resolve an abstract type (union or interface) to a real type.
When implemented, this message will be a field in the Resolution message.
This is the resolver map for the schema.
For each Type.Field, we can define a resolver.
if a field does not have resolver, the default resolver will be used.
the default resolver takes the field with the same name from the parent, and
uses that value to resolve the field. if a field with the same name does not
exist in the parent, null will be used.
Resolvers for scalar, non-root fields rarely fetch data and instead usually populate data via the parent argument.
Consequently, these fields inherit their default maxAge from their parent to reduce schema clutter.
TODO: Talk with product – apollo does not do this, but we could factor in upstream Cache-Control header
response into our inheritance model.
number of seconds to cache result for. the max_age used for a single graphql request is the minimum of all fields requested. default max_age rules work as follows: - root fields (i.e. Query, Mutation, Subscription) default to 0s - non-root, non-scalar fields (i.e. object, interface, or union; or a list of those types) default to 0s - all other fields inherit the max_age from their parent.
provide controls to which users can access cached content.
inheritMaxAge
bool
whether or not to inherit the caching configuration of any parent fields.
CacheControlScope
Name
Description
UNSET
PUBLIC
Responses for requests with Authorization header fields must not be stored in a shared cache. But the public directive will cause such responses to be stored in a shared cache. In general, when pages are under Basic Auth or Digest Auth, the browser sends requests with the Authorization header. That means the response is access-controlled for restricted users (who have accounts), and it’s fundamentally not shared-cacheable, even if it has max-age. You can use the public directive to unlock that restriction.
PRIVATE
You should add the private directive for user-personalized content — in particular, responses received after login, and sessions managed via cookies. If you forget to add private to a response with personalized content, then that response can be stored in a shared cache and end up being reused for multiple users, which can cause personal information to leak.
GraphQLConfig
Filter Listener config. Empty as the filter must be configured on the route
level.
Field
Type
Description
GraphQLRouteConfig
Filter Route config. Routes that have this config will execute graphql
queries, and will not make it to the router filter. i.e. this filter will
terminate the request for these routes.
Safelist: only allow queries to be executed that match these sha256 hashes. The hash can be computed from the query string or provided (i.e. persisted queries).
PersistedQueryCacheConfig
This message specifies Persisted Query Cache configuration.
"cacheSize": int
Field
Type
Description
cacheSize
int
The unit is number of queries to store, default to 1000.
Do we enable introspection for the schema? general recommendation is to disable this for production and hence it defaults to false.
maxDepth
int
The max amount of nesting a query can be executed against this schema. e.g. the following query has these depths: query { # Depth: 0 me { # Depth: 1 friends { # Depth: 2 friends # Depth: 3 } } } If the max_depth is set to 2, then the query at depth 3 will receive an error as a response. The max_depth value of 0 (set by default) will allow an unbounded query depth.
Set the extraction type to use a static value. Only one of value, header, or dynamicMetadata can be set.
header
string
Set the extraction type to use a header value. Specify the name of the header to extract the value from on the original request. Only one of header, value, or dynamicMetadata can be set.