Skip to content

Commit

Permalink
Ignore hidden queries
Browse files Browse the repository at this point in the history
Fixes #83
  • Loading branch information
marcusolsson committed Mar 21, 2021
1 parent 4352df6 commit c5975d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export class JsonDataSource extends DataSourceApi<JsonApiQuery, JsonApiDataSourc
}

async query(request: DataQueryRequest<JsonApiQuery>): Promise<DataQueryResponse> {
const promises = request.targets.map((query) => this.doRequest(query, request.range, request.scopedVars));
const promises = request.targets
.filter((query) => !query.hide)
.map((query) => this.doRequest(query, request.range, request.scopedVars));

// Wait for all queries to finish before returning the result.
return Promise.all(promises).then((data) => ({ data }));
Expand Down

0 comments on commit c5975d7

Please sign in to comment.