This repository has been archived by the owner on Mar 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
122 lines (115 loc) · 4.15 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# GraphQL schema describing everything the API exposes
# A user
type User {
id: ID!
name: String!
# everything this user did...
votes: [Vote]
modifications: [Modification]
recipes: [Recipe]
stash: [StashItem]
reviews: [Review]
comments: [Comment]
}
# A users vote for a modification
type Vote {
id: ID!
user: User!
date: DateTime!
# What is the users vote? approve, reject, abstain?
# FIXME: could be Boolean and allow nulls == abstain?
vote: String!
# An additional comment, to explain the vote. E. g. a user might vote abstain, but provide some information why...
reason: String
}
# A modification describes modifications to an entry in such a way that they can be applied and rolled back.
# This could be as simple as:
# modify attribute_name old_value new_value => modify name 'Capella' 'Capella Flavors'
# add type ID => add URL 1234
# rm type ID => rm URL 1234
# ...
type Modification {
id: ID!
# Text describing the modification, see above foo examples
modification: String!
user: User!
date: DateTime!
# Why should other users approve of this? Could be just an URL to a site backing up the claim.
# FIXME: naming
plea: String!
# Is this modification applied / approved?
is_applied: Boolean!
# Has it been canceled?
is_canceled: Boolean!
# If it has been canceled, here's the reason why: rejected by community, rejected by admin, rejected by antispambot, canceled by user...
cancel_reason: String
# For modifications that can not be applied directly (e. g. renaming a vendor or concentrate) it's possible for other users to vote on this modification
votes: [Vote]
}
# URL linking to a company site, external review, ...
type URL {
id: ID!
# Uniform resource locator
url: String!
# Text describing the content found at the URL in more detail
description: String
# Type of the URL: company, flavor, shop, review...
# FIXME: Do we need this?
# FIXME: Should this be a hard coded or...
type: URLType!
# Has this URL been approved?
is_approved: Boolean!
# Has this URL pedning modifications?
has_pending_mods: Boolean!
# In what language(s) is the content this URL is pointing too?
iso_lang: [String]!
# List of pending, applied and rejected modifications to this entry
modifications: [Modification]
}
# Vendor aka company producing flavor concentrates
type Vendor {
id: ID!
# Official name of the company: Capella® Flavors, flavorah ...
name: String!
# Abbreviation for this company: CAP, FLV ...
abbreviation: String!
# List of URLs in relation to this vendor: company site, reviews, shop links
urls: [URL]
# FIXME: What additional info do we want here? Founded date, headquarter location? I'd suggest we keep this as basic as possible.
# List of pending, applied and rejected modifications to this entry
modifications: [Modification]
# List of concentrates of this vendor
concentrates: [concentrate]
# FIXME: not sure if we want tags here
tags: [Tag]
reviews: [Review]
ratings: [Rating]
}
# Concentrate aka flavor
type Concentrate {
id: ID!
# Official name of the concentrate
name: String!
# List of aliases this concentrate is also known for
# Maybe catch common typos / misnomas here?
aliases: [String]
# Density of the concentrate ml/mg
density: Float
# Number of recipes this concentrate is used in
nr_of_recipes: Int!
# Average percentage it's used in these recipes
avg_percentage: Float!
# Suggested percentage if this is used as single flavor
# FIXME: this is debatable, so there are probably more than one suggestion here. we could make this an extra type Percentage with user attribute etc. pp.
single_percentage: Float!
# Suggested percentage in a mix
mix_percentage: Float!
tags: [Tag]
reviews: [Review]
ratings: [Rating]
# A list of concentrates related to this one. Be it because they are used together in mixes, are liked by the same users ...
related_concentrates: [Concentrate]
# Kind of the same of the above, but with more of a users context. Maybe filtered by what's in the users stash or what might be a good fit based on the recipes the user likes...
suggested_concentrates: [Concentrate]
}
# incomplete, please add stuff