googledatastudio / community-connectors

This repository contains open source content for Google Data Studio.
https://datastudio.google.com/
Apache License 2.0
554 stars 264 forks source link

Imparative declaration of Schema with cc.getFields() broken #365

Open sebdei opened 4 years ago

sebdei commented 4 years ago

It seems like that the imparative declaration of the schema as seen in the example custom connector is broken.

After returning a plain JSON schema in getFields() it was fixxed.


function getFields() {
   return [ 
       { 
        dataType: 'STRING',
        label: 'Package',
        name: 'packageName' 
      },
      { 
        name: 'day',
        dataType: 'STRING',
        label: 'Date' 
      },
      { 
        label: 'Downloads',
        defaultAggregationType: 'SUM',
        name: 'downloads',
        dataType: 'NUMBER' 
      } 
    ]
}