Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hschne/graphql-groups-demo

A demo project for graphql-groups
https://github.com/hschne/graphql-groups-demo

demo graphql-ruby grapqhl heroku ruby ruby-gem

Last synced: 23 days ago
JSON representation

A demo project for graphql-groups

Awesome Lists containing this project

README

        

# Demo for GraphQL Groups

To showcase [graphql-groups](https://github.com/hschne/graphql-groups) this demo project allows you to retrive statistical
data surrounding a dataset of movies. You can play around with it here: [https://graphql-groups-demo.herokuapp.com/](https://graphql-groups-demo.herokuapp.com/)

Movies have attributes like revenue, their release date and so on. See the queries below for some inspiration of what kind
of information you can retrieve.

Then check [`movie_group_type`](./app/graphql/types/movie_group_type.rb) and [`movie_group_result_type`](./app/graphql/types/movie_group_result_type.rb)
for the implementation.

#### Movie count per on runtime

```graphql
query runtimeCount{
groupBy {
runtime {
key
count
}
}
}
```

#### Average revenue of all movies per year

```graphql
query revenueAverage{
groupBy {
releaseDate(timeframe:YEAR) {
key
count
avg {
revenue
}
}
}
}
```

#### Movies per rating per year, as well as minumum and maximum budget per group

```graphql
query yearRatingBudgets {
groupBy {
releaseDate(timeframe:YEAR) {
key
groupBy {
popularity {
key
count
max {
budget
}
min {
budget
}
}
}
}
}
}
```