Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Garden Planner GraphQL schema v0.1
enum SourceType {
"""Use this for a shop, nursery, etc."""
PROPAGATOR
"""Use this option for websites, books, databases, etc."""
INFO
}
enum PropagatorType {
SEED
BULB
CORM
BAREROOT
RHIZOME
CUTTING
}
enum PlantingAreaShape {
CIRCLE
POLYGON
}
enum GrowthHabit {
BUSH
VINE
TREE
HERB
CREEPING
}
enum Lifespan {
PERENNIAL
BIANNUAL
ANNUAL
}
enum SpaceUnit {
CM
IN
FT
M
}
enum TimeUnit {
DAY
WEEK
MONTH
YEAR
SEASON
}
enum TemperatureUnit {
C
F
}
"""A shop, website, api"""
type Source {
id: ID!
name: String
url: String
date: String
type: SourceType
author: String
ISBN: String
propagators: [Propagator] @relation(name: "SOURCE", direction: "OUT")
}
"""A plant, varierty or subspecies"""
type CatalogEntry {
id: ID!
name: String!
scientific_name: String!
cultivar_name: String
description: String
image_url: String!
growth_habbit: GrowthHabit
duration: Lifespan
spread: Float
spread_unit: SpaceUnit
height: Float
height_unit: SpaceUnit
row_distance: Float
row_distance_unit: SpaceUnit
rotation: Int
rotation_unit: TimeUnit
notes: String
observations: String
sources: [Source] @relation(name: "SOURCE", direction: "IN")
propagators: [Propagator] @relation(name: "PROPAGATOR", direction: "IN")
companions: [CatalogEntry] @relation(name: "COMPANION", direction: "BOTH")
anthagonists: [CatalogEntry] @relation(name: "ANTAGONIST", direction: "BOTH")
}
"""A particular seed, bulb, etc with information about sowing times and such"""
type Propagator {
id: ID!
type: PropagatorType
plant_container: Boolean
min_planting_temperatature: Float
min_planting_temperature_unit: TemperatureUnit
germination_period: Int
germination_period_unit: TimeUnit
sow_indoor: Int
sow_indoor_unit: TimeUnit
resowing_interval: Int
resowing_interval_units: TimeUnit
sow_directly: Boolean
sowing_depth: Float
sowing_depth_unit: SpaceUnit
color: String
icon: String
notes: String
observations: String
buy_again: Boolean
sources: [Source] @relation(name: "SOURCE", direction: "IN")
cultures: [Culture] @relation(name: "CULTURE", direction: "IN")
}
"""A planting round / season for a specific propagator"""
type Culture {
id: ID!
start: String!
end: String
plants: Int
label: String
harvested: Boolean
harvest_date: String
observations: String
places: [PlantingArea] @relation(name: "CULTURE", direction: "OUT")
propagator: Propagator @relation(name: "TYPE", direction: "OUT")
}
"""A plantplanting area"""
interface PlantingArea {
id: ID!
name: String!
shape: PlantingAreaShape!
area: Float
area_unit: SpaceUnit
depth: Float
depth_unit: SpaceUnit
location: Point
plantings: [Culture] @relation(name: "CULTURE", direction: "IN")
}
"""A plantplanting area (circle)"""
type PlantingAreaCircle implements PlantingArea {
id: ID!
name: String!
shape: PlantingAreaShape!
diameter: Float
diameter_unit: SpaceUnit
circumference: Float
circumference_unit: SpaceUnit
area: Float
area_unit: SpaceUnit
depth: Float
depth_unit: SpaceUnit
radius: Float
radius_unit: SpaceUnit
location: Point
plantings: [Culture] @relation(name: "CULTURE", direction: "IN")
}
"""A plantplanting area (polygon)"""
type PlantingAreaPolygon implements PlantingArea {
id: ID!
name: String!
area: Float
area_unit: SpaceUnit
depth: Float
depth_unit: SpaceUnit
shape: PlantingAreaShape!
sides: [Float!]!
side_unit: SpaceUnit!
location: Point
plantings: [Culture] @relation(name: "CULTURE", direction: "IN")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment