Skip to content

Commit

Permalink
fix: resolve, do not resolve fetch if ctx is cancelled (wundergraph#518
Browse files Browse the repository at this point in the history
…) (#344)

PR from WG: wundergraph#518

Co-authored-by: Yuri Buerov <yuribuerov@gmail.com>
  • Loading branch information
pvormste and YuriBuerov committed Apr 14, 2023
1 parent 738c1d2 commit fbca674
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/engine/resolve/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,10 @@ func (r *Resolver) freeResultSet(set *resultSet) {
}

func (r *Resolver) resolveFetch(ctx *Context, fetch Fetch, data []byte, set *resultSet) (err error) {
// if context is cancelled, we should not resolve the fetch
if errors.Is(ctx.Err(), context.Canceled) {
return nil
}

switch f := fetch.(type) {
case *SingleFetch:
Expand Down

0 comments on commit fbca674

Please sign in to comment.