Skip to content

Commit

Permalink
server-gateway-interface: work with AS2 too (#184)
Browse files Browse the repository at this point in the history
The consumer of this in `@apollo/gateway` is already doing some weird
stuff with `Omit` around this field, so just explicitly allow the AS2
case.

See apollographql/federation#2077
  • Loading branch information
glasser authored and trevor-scheer committed Oct 19, 2022
1 parent d86f0b0 commit c1bb1e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/server-gateway-interface/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ export interface GatewayGraphQLRequestContext<TContext = Record<string, any>> {
readonly errors?: ReadonlyArray<GraphQLError>;
readonly metrics: GatewayGraphQLRequestMetrics;
debug?: boolean;
readonly overallCachePolicy: GatewayCachePolicy;
// In AS3 and AS4, this field is always set and is a GatewayCachePolicy, but
// in AS2 it is not always set and is only a GatewayCacheHint. To keep Gateway
// compatible with AS2, we allow either case here.
readonly overallCachePolicy?: GatewayCachePolicy | GatewayCacheHint;
}

export interface GatewayGraphQLRequest {
Expand Down

0 comments on commit c1bb1e8

Please sign in to comment.