Skip to content

Commit

Permalink
Default intervals to grafana intervals - fix for SQL query type
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Baptiste Guerraz committed Feb 9, 2021
1 parent b1ba4a2 commit b5cee7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class QueryEditor extends PureComponent<Props, State> {
const { query, onChange, onRunQuery } = this.props;

//todo: need to implement some kind of hook system to alter a query from modules
if (queryBuilderOptions.builder.intervals.length === 0) {
if (Array.isArray(queryBuilderOptions.builder.intervals) && queryBuilderOptions.builder.intervals.length === 0) {
queryBuilderOptions.builder.intervals.push('${__from:date:iso}/${__to:date:iso}');
}
//workaround (https://github.com/grafana/grafana/issues/30013)
Expand Down

0 comments on commit b5cee7f

Please sign in to comment.