metaforecast/schema.graphql

189 lines
3.9 KiB
GraphQL
Raw Permalink Normal View History

2022-04-19 21:29:12 +00:00
input CreateDashboardInput {
2022-04-25 20:23:31 +00:00
"""
The creator of the dashboard, e.g. "Peter Parker"
"""
2022-04-19 21:29:12 +00:00
creator: String
2022-04-25 20:23:31 +00:00
"""The longer description of the dashboard"""
2022-04-19 21:29:12 +00:00
description: String
2022-04-25 20:23:31 +00:00
"""List of question ids"""
2022-04-19 21:29:12 +00:00
ids: [ID!]!
2022-04-25 20:23:31 +00:00
"""The title of the dashboard"""
2022-04-19 21:29:12 +00:00
title: String!
}
type CreateDashboardResult {
dashboard: Dashboard!
}
type Dashboard {
2022-04-25 20:23:31 +00:00
"""
The creator of the dashboard, e.g. "Peter Parker"
"""
creator: String!
2022-04-25 20:23:31 +00:00
"""The longer description of the dashboard"""
description: String!
id: ID!
2022-04-25 20:23:31 +00:00
"""The list of questions on the dashboard"""
questions: [Question!]!
2022-04-25 20:23:31 +00:00
"""The title of the dashboard"""
title: String!
}
"""Date serialized as the Unix timestamp."""
scalar Date
2022-04-27 19:02:14 +00:00
type History implements QuestionShape {
description: String!
"""History items are identified by their integer ids"""
id: ID!
options: [ProbabilityOption!]!
platform: Platform!
qualityIndicators: QualityIndicators!
"""Unique string which identifies the question"""
questionId: ID!
"""Timestamp at which metaforecast fetched the question"""
timestamp: Date!
title: String!
"""
Non-unique, a very small number of platforms have a page for more than one prediction
"""
url: String!
}
2022-04-19 21:29:12 +00:00
type Mutation {
2022-04-25 20:23:31 +00:00
"""
Create a new dashboard; if the dashboard with given ids already exists then it will be returned instead.
"""
2022-04-19 21:29:12 +00:00
createDashboard(input: CreateDashboardInput!): CreateDashboardResult!
}
type PageInfo {
endCursor: String
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
}
2022-04-25 20:23:31 +00:00
"""Forecasting platform supported by Metaforecast"""
type Platform {
2022-04-25 20:23:31 +00:00
"""
Short unique platform name, e.g. "xrisk"
"""
id: ID!
2022-04-25 20:23:31 +00:00
"""
Platform name for displaying on frontend etc., e.g. "X-risk estimates"
"""
label: String!
2022-04-27 19:02:14 +00:00
lastUpdated: Date
}
type ProbabilityOption {
name: String
2022-04-25 20:23:31 +00:00
"""0 to 1"""
probability: Float
}
"""Various indicators of the question's quality"""
type QualityIndicators {
liquidity: Float
numForecasters: Int
numForecasts: Int
openInterest: Float
sharesVolume: Float
spread: Float
2022-04-25 20:23:31 +00:00
"""0 to 5"""
stars: Int!
tradeVolume: Float
volume: Float
}
2022-04-13 22:07:57 +00:00
type Query {
2022-04-25 20:23:31 +00:00
"""Look up a single dashboard by its id"""
dashboard(id: ID!): Dashboard!
2022-04-25 20:23:31 +00:00
"""Get a list of questions that are currently on the frontpage"""
2022-04-13 22:07:57 +00:00
frontpage: [Question!]!
2022-04-27 19:02:14 +00:00
platforms: [Platform!]!
"""Look up a single question by its id"""
question(id: ID!): Question!
questions(after: String, before: String, first: Int, last: Int): QueryQuestionsConnection!
2022-04-25 20:23:31 +00:00
"""
Search for questions; uses Algolia instead of the primary metaforecast database
"""
searchQuestions(input: SearchInput!): [Question!]!
}
type QueryQuestionsConnection {
edges: [QueryQuestionsConnectionEdge]!
pageInfo: PageInfo!
}
type QueryQuestionsConnectionEdge {
cursor: String!
node: Question!
2022-04-13 22:07:57 +00:00
}
2022-04-27 19:02:14 +00:00
type Question implements QuestionShape {
description: String!
2022-04-27 19:02:14 +00:00
history: [History!]!
2022-04-25 20:23:31 +00:00
"""Unique string which identifies the question"""
id: ID!
options: [ProbabilityOption!]!
platform: Platform!
qualityIndicators: QualityIndicators!
2022-04-25 20:23:31 +00:00
"""Timestamp at which metaforecast fetched the question"""
timestamp: Date!
2022-04-13 22:07:57 +00:00
title: String!
2022-04-25 20:23:31 +00:00
"""
Non-unique, a very small number of platforms have a page for more than one prediction
"""
url: String!
visualization: String
2022-04-13 22:07:57 +00:00
}
2022-04-27 19:02:14 +00:00
interface QuestionShape {
description: String!
options: [ProbabilityOption!]!
platform: Platform!
qualityIndicators: QualityIndicators!
"""Timestamp at which metaforecast fetched the question"""
timestamp: Date!
title: String!
"""
Non-unique, a very small number of platforms have a page for more than one prediction
"""
url: String!
}
input SearchInput {
2022-04-25 20:23:31 +00:00
"""List of platform ids to filter by"""
forecastingPlatforms: [String!]
2022-04-25 20:23:31 +00:00
"""Minimum number of forecasts on a question"""
forecastsThreshold: Int
limit: Int
query: String!
2022-04-25 20:23:31 +00:00
"""Minimum number of stars on a question"""
starsThreshold: Int
}