-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
142 lines (124 loc) · 3.25 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
type Query {
forecasts: [Forecast!]!
metadata: Metadata!
}
"""
A prediction about the future.
"""
type Forecast {
id: ID!
title: String!
description: String!
created: Time!
"""
The point in time at which you predict you will be able to resolve whether
how the forecast resolved.
"""
resolves: Time!
"""
The point in time at which you no longer want to update your probability
estimates for the forecast. In most cases you won't need this. One example
where you might is when you want to predict the outcome of an exam. You may
want to set 'closes' to the time right before the exam starts, even though
'resolves' is several weeks later (when the exam results are published). This
way your prediction history will only reflect your estimations before you
took the exam, which is something you may want (or not, in which case you
could simply not set 'closes').
"""
closes: Time
resolution: Resolution!
estimates: [Estimate]!
}
"""
A list of probabilities (one for each outcome) together with a timestamp and
an explanation why you made this estimate. Every time you change your mind
about a forecast you will create a new Estimate.
All probabilities always add up to 100.
"""
type Estimate {
id: ID!
created: Time!
reason: String!
probabilities: [Probability]!
brierScore: Float
}
"""
A number between 0 and 100 tied to a specific Outcome. It is always part of
an Estimate.
"""
type Probability {
id: ID!
value: Int!
outcome: Outcome!
}
"""
The possible results of a forecast. In the simplest case you will only have
two outcomes: Yes and No.
"""
type Outcome {
id: ID!
text: String!
correct: Boolean!
}
input NewForecast {
title: String!
description: String!
resolves: Time!
closes: Time
"""
An optional date in the past when you created this forecast. This can be
useful for cases when you wrote it down on a piece of paper or when importing
from other software.
"""
created: Time
}
input NewEstimate {
reason: String!
probabilities: [NewProbability!]!
"""
An optional date in the past when you created this estimate. This can be
useful for cases when you wrote it down on a piece of paper or when importing
from other software. When creating a new Forecast this value will be for
the first Estimate (which will get the same timestamp as the
Forecast.Created).
"""
created: Time
}
input NewProbability {
value: Int!
"""
A NewOutcome that needs to be specified when creating a Forecast for the very
first time. It must not be included when creating later Estimates for an
existing Forecast.
"""
outcome: NewOutcome
"""
An Outcome ID that needs to be specified when creating an Estimate for an
existing Forecast. It must not be included when creating a Forecast.
"""
outcomeId: ID
}
input NewOutcome {
text: String!
}
type Mutation {
createForecast(forecast: NewForecast!, estimate: NewEstimate!): Forecast!
resolveForecast(
forecastId: ID!,
resolution: Resolution,
correctOutcomeId: ID
): Forecast
createEstimate(forecastId: ID!, estimate: NewEstimate!): Estimate!
}
scalar Time
enum Resolution {
RESOLVED
NOT_APPLICABLE
UNRESOLVED
}
"""
Information about the application itself e.g. the current version.
"""
type Metadata {
version: String!
}