jazzido / mondrian-rest

A REST interface for Mondrian ROLAP server
MIT License
32 stars 8 forks source link

[Feature] GraphQL endpoint #7

Open jazzido opened 7 years ago

jazzido commented 7 years ago

GraphQL seems like a natural candidate to express aggregations to mondrian-rest.

jazzido commented 7 years ago

[Jotting down a possible sample of a query]

From mondrian-rest-demo:

/cubes/Trade Flow/aggregate.csv?drilldown[]=Year&measures[]=Exports&cut[]=Origin Country.South America&cut[]=Destination%20Country.Europe.Germany&cut[]=Product.Live%20Animals

Can be expressed as follows:

tradeFlow {
  measures {
    Exports
  }

  drilldowns {
    Year
  }

  cuts {
    Origin_Country {
      South America
    }
    Destination_Country {
      Europe {
        Germany
      }
    }
    Product {
      Live_Animals
    }
  }
}

This would require types to be generated programmatically by the endpoint, by inspecting the structure of a cube. F# Type Providers are a good source of inspiration for this.