Creating a custom panel plugin using mysql as datasource

Hi,
I’m trying to create a custom funnel plugin, which uses mysql as datasource. I want to use this as the base of it and then just integrate it into grafana. However I couldn’t find in the docs how should I get the data. In all honesty I’m a beginner, but as far as I understand it the mysql query is processed by grafana and then I should somehow get the data directly from grafan and feed it to the plugin. Is there a particular function that does that? Note that I’m trying to use just normal data, as if I’m using a table and not time series.

Cheers