curvegrid / multibaas-for-google-sheets

MIT License
8 stars 4 forks source link

Custom event queries don't handle block_number and triggered_at properly #64

Open shoenseiwaso opened 3 years ago

shoenseiwaso commented 3 years ago

In an Event Query, for non-event fields in the select section (block_number, triggered_at, etc.), no inputIndex should be provided, and the event type should be set to its type, rather than index:

image

In a custom event query in a spreadsheet, if we leave index blank: image

It leads to an error:

image

Note the null for inputIndex which should be empty:

image

Console log:

"log": "time=\"2021-02-19 01:59:21.260274Z\" level=info msg=\"API call result: /api/v0/queries\" api_key=2 forwarded-for=35.187.133.201 internal=\"missing field index\" message=\"invalid request\" method=POST

The fix is basically this:

I.e.:

As-is:
{"alias":"block_number","inputIndex":null,"type":"input"}

To-be:
{"alias":"block_number","type":"block_number"}