Skip to content

Commit

Permalink
reinstate the check for existing results that accidentally got removed
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispatrick committed Feb 6, 2024
1 parent 57cf86a commit 6a990e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions policy/data/gql_async.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ func NewAsyncDataSource(
}

func (ds AsyncDataSource) Query(ctx context.Context, queryName string, query string, variables map[string]interface{}, output interface{}) (*QueryResponse, error) {
if existingResult, ok := ds.asyncResults[queryName]; ok {
return &QueryResponse{}, edn.Unmarshal(existingResult.Data, output)
}

if len(ds.asyncResults) > 0 && !ds.multipleQuerySupport {
ds.log.Debugf("skipping async query for query %s due to lack of multipleQuerySupport", queryName)
return nil, nil // don't error, in case there is another applicable query executor down-chain
Expand Down

0 comments on commit 6a990e7

Please sign in to comment.