Skip to content

Instantly share code, notes, and snippets.

@joeboyscout04
Last active April 21, 2020 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeboyscout04/6e43859c81030661b461ea1b3ddac7b5 to your computer and use it in GitHub Desktop.
Save joeboyscout04/6e43859c81030661b461ea1b3ddac7b5 to your computer and use it in GitHub Desktop.
Proposal for GraphQL data schema
enum CatchStatisticsProperty {
WEATHER_CONDITION
WIND_DIRECTION
WIND_SPEED
AIR_PRESSURE
MOON_PHASE
SUN_PHASE
HOUR_OF_DAY
MONTH_OF_YEAR
AIR_TEMPERATURE
LURE_CATEGORY
FISHING_METHOD
}
/// Idea 1
catchStatistics(fromDate: Date?, toDate: Date?, speciesId: [Int!]?, property: CatchStatisticsProperty!) {
xAxisTitle: String!
yAxisTitle: String!
xAxisLabels: [AxisSeries]
dataSeries: [DataSeries]!
}
DataSeries {
name: String?
values: [Float!]!
}
AxisSeries {
name: String!
value: Float?
}
/// Example with data
{
"xAxisTitle": "Air Pressure (kPa)",
"yAxisTitle": "Number of Catches",
"xAxisLabels": [
{
"name": "990",
"value": 990
},
{
"name": "1000",
"value": 1000
},
{
"name": "1010",
"value": 1010
}
],
"dataSeries": [
{
name: "Catches"
values: [0,3,10]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment