metaforecast/schema.graphql

138 lines
2.7 KiB
GraphQL
Raw 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-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!
}
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 {
numForecasts: Int
2022-04-25 20:23:31 +00:00
"""0 to 5"""
stars: Int!
}
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!]!
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
}
type Question {
description: String!
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
}
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
}