Perspective component : Fetch data from gateway

Hi,
I am looking at the Perspective module example and able to build the module with some UI components and static data. Next thing I want to do is fetch data from the Gateway’s default datasource.

For Vision component, we used RPC to communicate with Gateway and used DatasourceManager , Datasource and SRConnection APIs to fetch/store data from/to the database, however have following questions with respect to fetching data from Gateway through the Perspective UI.

  1. Do we need RPC mechanism to query database as Perspective module is on the Gateway itself ?
  2. How do we get the GatewayContext in the React component ?
  3. Do we need to use only NamedQueries to fetch data ?

Appreciate help regarding the same.