Skip to content

Commit

Permalink
Fix bug in context-matching logic for interfaces-implementing-interfa…
Browse files Browse the repository at this point in the history
…ces (#3014)

A field is considered to match a context if the field's parent type (in
the original query) either has `@context` on it, or implements/is a
member of a type with `@context` on it. We ended up missing the case
where interfaces implement interfaces; this PR introduces a fix.
  • Loading branch information
sachindshinde authored May 22, 2024
1 parent 2c37ad4 commit 907babf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion query-graphs-js/src/graphPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,7 @@ function canSatisfyConditions<TTrigger, V extends Vertex, TNullEdge extends null
if (parentInSupergraph.name === t) {
return true;
}
if (isObjectType(parentInSupergraph)) {
if (isObjectType(parentInSupergraph) || isInterfaceType(parentInSupergraph)) {
if (parentInSupergraph.interfaces().some(i => i.name === t)) {
return true;
}
Expand Down

0 comments on commit 907babf

Please sign in to comment.