Fix toggle field logic

pull/10616/head
Andrew Watkins 2017-10-12 11:07:30 -07:00
parent d13d62d271
commit 2ea9272fcd
1 changed files with 4 additions and 5 deletions

View File

@ -75,16 +75,15 @@ export const toggleField = (query, {name, type}) => {
}
}
if (!newFuncs) {
// if we are not applying functions apply a field
if (!newFuncs.length) {
return {
...query,
fields: [
...fields,
{
type: 'func',
alias: `mean_${name}`,
args: [{name, type: 'field'}],
name: 'mean',
name,
type: 'field',
},
],
}