Merge pull request #70 from quantified-uncertainty/indicators-fix

Indicators fix
This commit is contained in:
Vyacheslav Matyukhin 2022-04-25 23:46:21 +03:00 committed by GitHub
commit 72600947d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 173 additions and 47 deletions

View File

@ -1,7 +1,16 @@
input CreateDashboardInput { input CreateDashboardInput {
"""
The creator of the dashboard, e.g. "Peter Parker"
"""
creator: String creator: String
"""The longer description of the dashboard"""
description: String description: String
"""List of question ids"""
ids: [ID!]! ids: [ID!]!
"""The title of the dashboard"""
title: String! title: String!
} }
@ -10,10 +19,19 @@ type CreateDashboardResult {
} }
type Dashboard { type Dashboard {
"""
The creator of the dashboard, e.g. "Peter Parker"
"""
creator: String! creator: String!
"""The longer description of the dashboard"""
description: String! description: String!
id: ID! id: ID!
"""The list of questions on the dashboard"""
questions: [Question!]! questions: [Question!]!
"""The title of the dashboard"""
title: String! title: String!
} }
@ -21,6 +39,9 @@ type Dashboard {
scalar Date scalar Date
type Mutation { type Mutation {
"""
Create a new dashboard; if the dashboard with given ids already exists then it will be returned instead.
"""
createDashboard(input: CreateDashboardInput!): CreateDashboardResult! createDashboard(input: CreateDashboardInput!): CreateDashboardResult!
} }
@ -31,27 +52,52 @@ type PageInfo {
startCursor: String startCursor: String
} }
"""Platform supported by metaforecast""" """Forecasting platform supported by Metaforecast"""
type Platform { type Platform {
"""
Short unique platform name, e.g. "xrisk"
"""
id: ID! id: ID!
"""
Platform name for displaying on frontend etc., e.g. "X-risk estimates"
"""
label: String! label: String!
} }
type ProbabilityOption { type ProbabilityOption {
name: String name: String
"""0 to 1"""
probability: Float probability: Float
} }
"""Various indicators of the question's quality""" """Various indicators of the question's quality"""
type QualityIndicators { type QualityIndicators {
liquidity: Float
numForecasters: Int
numForecasts: Int numForecasts: Int
openInterest: Float
sharesVolume: Float
spread: Float
"""0 to 5"""
stars: Int! stars: Int!
tradeVolume: Float
volume: Float
} }
type Query { type Query {
"""Look up a single dashboard by its id"""
dashboard(id: ID!): Dashboard! dashboard(id: ID!): Dashboard!
"""Get a list of questions that are currently on the frontpage"""
frontpage: [Question!]! frontpage: [Question!]!
questions(after: String, before: String, first: Int, last: Int): QueryQuestionsConnection! questions(after: String, before: String, first: Int, last: Int): QueryQuestionsConnection!
"""
Search for questions; uses Algolia instead of the primary metaforecast database
"""
searchQuestions(input: SearchInput!): [Question!]! searchQuestions(input: SearchInput!): [Question!]!
} }
@ -67,20 +113,33 @@ type QueryQuestionsConnectionEdge {
type Question { type Question {
description: String! description: String!
"""Unique string which identifies the question"""
id: ID! id: ID!
options: [ProbabilityOption!]! options: [ProbabilityOption!]!
platform: Platform! platform: Platform!
qualityIndicators: QualityIndicators! qualityIndicators: QualityIndicators!
"""Timestamp at which metaforecast fetched the question"""
timestamp: Date! timestamp: Date!
title: String! title: String!
"""
Non-unique, a very small number of platforms have a page for more than one prediction
"""
url: String! url: String!
visualization: String visualization: String
} }
input SearchInput { input SearchInput {
"""List of platform ids to filter by"""
forecastingPlatforms: [String!] forecastingPlatforms: [String!]
"""Minimum number of forecasts on a question"""
forecastsThreshold: Int forecastsThreshold: Int
limit: Int limit: Int
query: String! query: String!
"""Minimum number of stars on a question"""
starsThreshold: Int starsThreshold: Int
} }

View File

@ -34,6 +34,8 @@ export interface QualityIndicators {
yes_bid?: any; yes_bid?: any;
yes_ask?: any; yes_ask?: any;
spread?: any; spread?: any;
open_interest?: any;
trade_volume?: any;
} }
export type FetchedQuestion = Omit< export type FetchedQuestion = Omit<

File diff suppressed because one or more lines are too long

View File

@ -34,18 +34,36 @@ export const QualityIndicatorsObj = builder
.objectRef<QualityIndicators>("QualityIndicators") .objectRef<QualityIndicators>("QualityIndicators")
.implement({ .implement({
description: "Various indicators of the question's quality", description: "Various indicators of the question's quality",
fields: (t) => ({ fields: (t) => {
stars: t.exposeInt("stars", { const maybeIntField = (name: keyof QualityIndicators) =>
description: "0 to 5", t.int({
}), nullable: true,
numForecasts: t.int({ resolve: (parent) =>
nullable: true, parent[name] === undefined ? undefined : Number(parent[name]),
resolve: (parent) => });
parent.numforecasts === undefined const maybeFloatField = (name: keyof QualityIndicators) =>
? undefined t.float({
: Number(parent.numforecasts), nullable: true,
}), resolve: (parent) =>
}), parent[name] === undefined ? undefined : Number(parent[name]),
});
return {
stars: t.exposeInt("stars", {
description: "0 to 5",
}),
numForecasts: maybeIntField("numforecasts"),
numForecasters: maybeIntField("numforecasters"),
volume: maybeFloatField("volume"),
// yesBid: maybeNumberField("yes_bid"),
// yesAsk: maybeNumberField("yes_ask"),
spread: maybeFloatField("spread"),
sharesVolume: maybeFloatField("shares_volume"),
openInterest: maybeFloatField("open_interest"),
liquidity: maybeFloatField("liquidity"),
tradeVolume: maybeFloatField("trade_volume"),
};
},
}); });
export const ProbabilityOptionObj = builder export const ProbabilityOptionObj = builder

View File

@ -15,9 +15,13 @@ export type Scalars = {
}; };
export type CreateDashboardInput = { export type CreateDashboardInput = {
/** The creator of the dashboard, e.g. "Peter Parker" */
creator?: InputMaybe<Scalars['String']>; creator?: InputMaybe<Scalars['String']>;
/** The longer description of the dashboard */
description?: InputMaybe<Scalars['String']>; description?: InputMaybe<Scalars['String']>;
/** List of question ids */
ids: Array<Scalars['ID']>; ids: Array<Scalars['ID']>;
/** The title of the dashboard */
title: Scalars['String']; title: Scalars['String'];
}; };
@ -28,15 +32,20 @@ export type CreateDashboardResult = {
export type Dashboard = { export type Dashboard = {
__typename?: 'Dashboard'; __typename?: 'Dashboard';
/** The creator of the dashboard, e.g. "Peter Parker" */
creator: Scalars['String']; creator: Scalars['String'];
/** The longer description of the dashboard */
description: Scalars['String']; description: Scalars['String'];
id: Scalars['ID']; id: Scalars['ID'];
/** The list of questions on the dashboard */
questions: Array<Question>; questions: Array<Question>;
/** The title of the dashboard */
title: Scalars['String']; title: Scalars['String'];
}; };
export type Mutation = { export type Mutation = {
__typename?: 'Mutation'; __typename?: 'Mutation';
/** Create a new dashboard; if the dashboard with given ids already exists then it will be returned instead. */
createDashboard: CreateDashboardResult; createDashboard: CreateDashboardResult;
}; };
@ -53,31 +62,45 @@ export type PageInfo = {
startCursor?: Maybe<Scalars['String']>; startCursor?: Maybe<Scalars['String']>;
}; };
/** Platform supported by metaforecast */ /** Forecasting platform supported by Metaforecast */
export type Platform = { export type Platform = {
__typename?: 'Platform'; __typename?: 'Platform';
/** Short unique platform name, e.g. "xrisk" */
id: Scalars['ID']; id: Scalars['ID'];
/** Platform name for displaying on frontend etc., e.g. "X-risk estimates" */
label: Scalars['String']; label: Scalars['String'];
}; };
export type ProbabilityOption = { export type ProbabilityOption = {
__typename?: 'ProbabilityOption'; __typename?: 'ProbabilityOption';
name?: Maybe<Scalars['String']>; name?: Maybe<Scalars['String']>;
/** 0 to 1 */
probability?: Maybe<Scalars['Float']>; probability?: Maybe<Scalars['Float']>;
}; };
/** Various indicators of the question's quality */ /** Various indicators of the question's quality */
export type QualityIndicators = { export type QualityIndicators = {
__typename?: 'QualityIndicators'; __typename?: 'QualityIndicators';
liquidity?: Maybe<Scalars['Float']>;
numForecasters?: Maybe<Scalars['Int']>;
numForecasts?: Maybe<Scalars['Int']>; numForecasts?: Maybe<Scalars['Int']>;
openInterest?: Maybe<Scalars['Float']>;
sharesVolume?: Maybe<Scalars['Float']>;
spread?: Maybe<Scalars['Float']>;
/** 0 to 5 */
stars: Scalars['Int']; stars: Scalars['Int'];
tradeVolume?: Maybe<Scalars['Float']>;
volume?: Maybe<Scalars['Float']>;
}; };
export type Query = { export type Query = {
__typename?: 'Query'; __typename?: 'Query';
/** Look up a single dashboard by its id */
dashboard: Dashboard; dashboard: Dashboard;
/** Get a list of questions that are currently on the frontpage */
frontpage: Array<Question>; frontpage: Array<Question>;
questions: QueryQuestionsConnection; questions: QueryQuestionsConnection;
/** Search for questions; uses Algolia instead of the primary metaforecast database */
searchQuestions: Array<Question>; searchQuestions: Array<Question>;
}; };
@ -114,20 +137,26 @@ export type QueryQuestionsConnectionEdge = {
export type Question = { export type Question = {
__typename?: 'Question'; __typename?: 'Question';
description: Scalars['String']; description: Scalars['String'];
/** Unique string which identifies the question */
id: Scalars['ID']; id: Scalars['ID'];
options: Array<ProbabilityOption>; options: Array<ProbabilityOption>;
platform: Platform; platform: Platform;
qualityIndicators: QualityIndicators; qualityIndicators: QualityIndicators;
/** Timestamp at which metaforecast fetched the question */
timestamp: Scalars['Date']; timestamp: Scalars['Date'];
title: Scalars['String']; title: Scalars['String'];
/** Non-unique, a very small number of platforms have a page for more than one prediction */
url: Scalars['String']; url: Scalars['String'];
visualization?: Maybe<Scalars['String']>; visualization?: Maybe<Scalars['String']>;
}; };
export type SearchInput = { export type SearchInput = {
/** List of platform ids to filter by */
forecastingPlatforms?: InputMaybe<Array<Scalars['String']>>; forecastingPlatforms?: InputMaybe<Array<Scalars['String']>>;
/** Minimum number of forecasts on a question */
forecastsThreshold?: InputMaybe<Scalars['Int']>; forecastsThreshold?: InputMaybe<Scalars['Int']>;
limit?: InputMaybe<Scalars['Int']>; limit?: InputMaybe<Scalars['Int']>;
query: Scalars['String']; query: Scalars['String'];
/** Minimum number of stars on a question */
starsThreshold?: InputMaybe<Scalars['Int']>; starsThreshold?: InputMaybe<Scalars['Int']>;
}; };

View File

@ -2,21 +2,21 @@ import * as Types from '../../graphql/types.generated';
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
import { QuestionFragmentDoc } from '../search/queries.generated'; import { QuestionFragmentDoc } from '../search/queries.generated';
export type DashboardFragment = { __typename?: 'Dashboard', id: string, title: string, description: string, creator: string, questions: Array<{ __typename?: 'Question', id: string, url: string, title: string, description: string, timestamp: number, visualization?: string | null, options: Array<{ __typename?: 'ProbabilityOption', name?: string | null, probability?: number | null }>, platform: { __typename?: 'Platform', id: string, label: string }, qualityIndicators: { __typename?: 'QualityIndicators', stars: number, numForecasts?: number | null } }> }; export type DashboardFragment = { __typename?: 'Dashboard', id: string, title: string, description: string, creator: string, questions: Array<{ __typename?: 'Question', id: string, url: string, title: string, description: string, timestamp: number, visualization?: string | null, options: Array<{ __typename?: 'ProbabilityOption', name?: string | null, probability?: number | null }>, platform: { __typename?: 'Platform', id: string, label: string }, qualityIndicators: { __typename?: 'QualityIndicators', stars: number, numForecasts?: number | null, numForecasters?: number | null, volume?: number | null, spread?: number | null, sharesVolume?: number | null, openInterest?: number | null, liquidity?: number | null, tradeVolume?: number | null } }> };
export type DashboardByIdQueryVariables = Types.Exact<{ export type DashboardByIdQueryVariables = Types.Exact<{
id: Types.Scalars['ID']; id: Types.Scalars['ID'];
}>; }>;
export type DashboardByIdQuery = { __typename?: 'Query', result: { __typename?: 'Dashboard', id: string, title: string, description: string, creator: string, questions: Array<{ __typename?: 'Question', id: string, url: string, title: string, description: string, timestamp: number, visualization?: string | null, options: Array<{ __typename?: 'ProbabilityOption', name?: string | null, probability?: number | null }>, platform: { __typename?: 'Platform', id: string, label: string }, qualityIndicators: { __typename?: 'QualityIndicators', stars: number, numForecasts?: number | null } }> } }; export type DashboardByIdQuery = { __typename?: 'Query', result: { __typename?: 'Dashboard', id: string, title: string, description: string, creator: string, questions: Array<{ __typename?: 'Question', id: string, url: string, title: string, description: string, timestamp: number, visualization?: string | null, options: Array<{ __typename?: 'ProbabilityOption', name?: string | null, probability?: number | null }>, platform: { __typename?: 'Platform', id: string, label: string }, qualityIndicators: { __typename?: 'QualityIndicators', stars: number, numForecasts?: number | null, numForecasters?: number | null, volume?: number | null, spread?: number | null, sharesVolume?: number | null, openInterest?: number | null, liquidity?: number | null, tradeVolume?: number | null } }> } };
export type CreateDashboardMutationVariables = Types.Exact<{ export type CreateDashboardMutationVariables = Types.Exact<{
input: Types.CreateDashboardInput; input: Types.CreateDashboardInput;
}>; }>;
export type CreateDashboardMutation = { __typename?: 'Mutation', result: { __typename?: 'CreateDashboardResult', dashboard: { __typename?: 'Dashboard', id: string, title: string, description: string, creator: string, questions: Array<{ __typename?: 'Question', id: string, url: string, title: string, description: string, timestamp: number, visualization?: string | null, options: Array<{ __typename?: 'ProbabilityOption', name?: string | null, probability?: number | null }>, platform: { __typename?: 'Platform', id: string, label: string }, qualityIndicators: { __typename?: 'QualityIndicators', stars: number, numForecasts?: number | null } }> } } }; export type CreateDashboardMutation = { __typename?: 'Mutation', result: { __typename?: 'CreateDashboardResult', dashboard: { __typename?: 'Dashboard', id: string, title: string, description: string, creator: string, questions: Array<{ __typename?: 'Question', id: string, url: string, title: string, description: string, timestamp: number, visualization?: string | null, options: Array<{ __typename?: 'ProbabilityOption', name?: string | null, probability?: number | null }>, platform: { __typename?: 'Platform', id: string, label: string }, qualityIndicators: { __typename?: 'QualityIndicators', stars: number, numForecasts?: number | null, numForecasters?: number | null, volume?: number | null, spread?: number | null, sharesVolume?: number | null, openInterest?: number | null, liquidity?: number | null, tradeVolume?: number | null } }> } } };
export const DashboardFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"Dashboard"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Dashboard"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"creator"}},{"kind":"Field","name":{"kind":"Name","value":"questions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"Question"}}]}}]}},...QuestionFragmentDoc.definitions]} as unknown as DocumentNode<DashboardFragment, unknown>; export const DashboardFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"Dashboard"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Dashboard"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"creator"}},{"kind":"Field","name":{"kind":"Name","value":"questions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"Question"}}]}}]}},...QuestionFragmentDoc.definitions]} as unknown as DocumentNode<DashboardFragment, unknown>;
export const DashboardByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"DashboardById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"result"},"name":{"kind":"Name","value":"dashboard"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"Dashboard"}}]}}]}},...DashboardFragmentDoc.definitions]} as unknown as DocumentNode<DashboardByIdQuery, DashboardByIdQueryVariables>; export const DashboardByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"DashboardById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"result"},"name":{"kind":"Name","value":"dashboard"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"Dashboard"}}]}}]}},...DashboardFragmentDoc.definitions]} as unknown as DocumentNode<DashboardByIdQuery, DashboardByIdQueryVariables>;

View File

@ -1,7 +1,12 @@
const formatQualityIndicator = (indicator) => { import { QuestionFragment } from "../../search/queries.generated";
let result;
type QualityIndicator = QuestionFragment["qualityIndicators"];
type IndicatorName = keyof QualityIndicator;
const formatQualityIndicator = (indicator: IndicatorName) => {
let result: string | null = null;
switch (indicator) { switch (indicator) {
case "numforecasts": case "numForecasts":
result = null; result = null;
break; break;
@ -13,38 +18,38 @@ const formatQualityIndicator = (indicator) => {
result = "Volume"; result = "Volume";
break; break;
case "numforecasters": case "numForecasters":
result = "Forecasters"; result = "Forecasters";
break; break;
case "yes_bid": // case "yesBid":
result = null; // "Yes bid" // result = null; // "Yes bid"
break; // break;
case "yes_ask": // case "yesAsk":
result = null; // "Yes ask" // result = null; // "Yes ask"
break; // break;
case "spread": case "spread":
result = "Spread"; result = "Spread";
break; break;
case "shares_volume": case "sharesVolume":
result = "Shares vol."; result = "Shares vol.";
break; break;
case "open_interest": case "openInterest":
result = "Interest"; result = "Interest";
break; break;
case "resolution_data": // case "resolution_data":
result = null; // result = null;
break; // break;
case "liquidity": case "liquidity":
result = "Liquidity"; result = "Liquidity";
break; break;
case "tradevolume": case "tradeVolume":
result = "Volume"; result = "Volume";
break; break;
} }
@ -61,11 +66,11 @@ const formatNumber = (num) => {
} }
}; };
const formatQualityIndicators = (qualityIndicators: any) => { const formatQualityIndicators = (qualityIndicators: QualityIndicator) => {
let newQualityIndicators = {}; let newQualityIndicators: { [k: string]: string | number } = {};
for (let key in qualityIndicators) { for (const key of Object.keys(qualityIndicators)) {
let newKey = formatQualityIndicator(key); const newKey = formatQualityIndicator(key as IndicatorName);
if (newKey) { if (newKey && qualityIndicators[key] !== null) {
newQualityIndicators[newKey] = qualityIndicators[key]; newQualityIndicators[newKey] = qualityIndicators[key];
} }
} }
@ -74,7 +79,13 @@ const formatQualityIndicators = (qualityIndicators: any) => {
/* Display functions*/ /* Display functions*/
const getPercentageSymbolIfNeeded = ({ indicator, platform }) => { const getPercentageSymbolIfNeeded = ({
indicator,
platform,
}: {
indicator: string;
platform: string;
}) => {
let indicatorsWhichNeedPercentageSymbol = ["Spread"]; let indicatorsWhichNeedPercentageSymbol = ["Spread"];
if (indicatorsWhichNeedPercentageSymbol.includes(indicator)) { if (indicatorsWhichNeedPercentageSymbol.includes(indicator)) {
return "%"; return "%";
@ -87,7 +98,7 @@ const getCurrencySymbolIfNeeded = ({
indicator, indicator,
platform, platform,
}: { }: {
indicator: any; indicator: string;
platform: string; platform: string;
}) => { }) => {
let indicatorsWhichNeedCurrencySymbol = ["Volume", "Interest", "Liquidity"]; let indicatorsWhichNeedCurrencySymbol = ["Volume", "Interest", "Liquidity"];
@ -137,7 +148,7 @@ const displayQualityIndicators: React.FC<{
numforecasts: number; numforecasts: number;
lastUpdated: Date; lastUpdated: Date;
showTimeStamp: boolean; showTimeStamp: boolean;
qualityindicators: any; qualityindicators: QuestionFragment["qualityIndicators"];
platform: string; // id string - e.g. "goodjudgment", not "Good Judgment" platform: string; // id string - e.g. "goodjudgment", not "Good Judgment"
}> = ({ }> = ({
numforecasts, numforecasts,
@ -237,7 +248,7 @@ interface Props {
platform: string; platform: string;
platformLabel: string; platformLabel: string;
numforecasts: any; numforecasts: any;
qualityindicators: any; qualityindicators: QuestionFragment["qualityIndicators"];
lastUpdated: Date; lastUpdated: Date;
showTimeStamp: boolean; showTimeStamp: boolean;
expandFooterToFullWidth: boolean; expandFooterToFullWidth: boolean;

View File

@ -1,20 +1,20 @@
import * as Types from '../../graphql/types.generated'; import * as Types from '../../graphql/types.generated';
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
export type QuestionFragment = { __typename?: 'Question', id: string, url: string, title: string, description: string, timestamp: number, visualization?: string | null, options: Array<{ __typename?: 'ProbabilityOption', name?: string | null, probability?: number | null }>, platform: { __typename?: 'Platform', id: string, label: string }, qualityIndicators: { __typename?: 'QualityIndicators', stars: number, numForecasts?: number | null } }; export type QuestionFragment = { __typename?: 'Question', id: string, url: string, title: string, description: string, timestamp: number, visualization?: string | null, options: Array<{ __typename?: 'ProbabilityOption', name?: string | null, probability?: number | null }>, platform: { __typename?: 'Platform', id: string, label: string }, qualityIndicators: { __typename?: 'QualityIndicators', stars: number, numForecasts?: number | null, numForecasters?: number | null, volume?: number | null, spread?: number | null, sharesVolume?: number | null, openInterest?: number | null, liquidity?: number | null, tradeVolume?: number | null } };
export type FrontpageQueryVariables = Types.Exact<{ [key: string]: never; }>; export type FrontpageQueryVariables = Types.Exact<{ [key: string]: never; }>;
export type FrontpageQuery = { __typename?: 'Query', result: Array<{ __typename?: 'Question', id: string, url: string, title: string, description: string, timestamp: number, visualization?: string | null, options: Array<{ __typename?: 'ProbabilityOption', name?: string | null, probability?: number | null }>, platform: { __typename?: 'Platform', id: string, label: string }, qualityIndicators: { __typename?: 'QualityIndicators', stars: number, numForecasts?: number | null } }> }; export type FrontpageQuery = { __typename?: 'Query', result: Array<{ __typename?: 'Question', id: string, url: string, title: string, description: string, timestamp: number, visualization?: string | null, options: Array<{ __typename?: 'ProbabilityOption', name?: string | null, probability?: number | null }>, platform: { __typename?: 'Platform', id: string, label: string }, qualityIndicators: { __typename?: 'QualityIndicators', stars: number, numForecasts?: number | null, numForecasters?: number | null, volume?: number | null, spread?: number | null, sharesVolume?: number | null, openInterest?: number | null, liquidity?: number | null, tradeVolume?: number | null } }> };
export type SearchQueryVariables = Types.Exact<{ export type SearchQueryVariables = Types.Exact<{
input: Types.SearchInput; input: Types.SearchInput;
}>; }>;
export type SearchQuery = { __typename?: 'Query', result: Array<{ __typename?: 'Question', id: string, url: string, title: string, description: string, timestamp: number, visualization?: string | null, options: Array<{ __typename?: 'ProbabilityOption', name?: string | null, probability?: number | null }>, platform: { __typename?: 'Platform', id: string, label: string }, qualityIndicators: { __typename?: 'QualityIndicators', stars: number, numForecasts?: number | null } }> }; export type SearchQuery = { __typename?: 'Query', result: Array<{ __typename?: 'Question', id: string, url: string, title: string, description: string, timestamp: number, visualization?: string | null, options: Array<{ __typename?: 'ProbabilityOption', name?: string | null, probability?: number | null }>, platform: { __typename?: 'Platform', id: string, label: string }, qualityIndicators: { __typename?: 'QualityIndicators', stars: number, numForecasts?: number | null, numForecasters?: number | null, volume?: number | null, spread?: number | null, sharesVolume?: number | null, openInterest?: number | null, liquidity?: number | null, tradeVolume?: number | null } }> };
export const QuestionFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"Question"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Question"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"options"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"probability"}}]}},{"kind":"Field","name":{"kind":"Name","value":"platform"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}}]}},{"kind":"Field","name":{"kind":"Name","value":"qualityIndicators"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stars"}},{"kind":"Field","name":{"kind":"Name","value":"numForecasts"}}]}},{"kind":"Field","name":{"kind":"Name","value":"visualization"}}]}}]} as unknown as DocumentNode<QuestionFragment, unknown>; export const QuestionFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"Question"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Question"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"options"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"probability"}}]}},{"kind":"Field","name":{"kind":"Name","value":"platform"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}}]}},{"kind":"Field","name":{"kind":"Name","value":"qualityIndicators"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stars"}},{"kind":"Field","name":{"kind":"Name","value":"numForecasts"}},{"kind":"Field","name":{"kind":"Name","value":"numForecasters"}},{"kind":"Field","name":{"kind":"Name","value":"volume"}},{"kind":"Field","name":{"kind":"Name","value":"spread"}},{"kind":"Field","name":{"kind":"Name","value":"sharesVolume"}},{"kind":"Field","name":{"kind":"Name","value":"openInterest"}},{"kind":"Field","name":{"kind":"Name","value":"liquidity"}},{"kind":"Field","name":{"kind":"Name","value":"tradeVolume"}}]}},{"kind":"Field","name":{"kind":"Name","value":"visualization"}}]}}]} as unknown as DocumentNode<QuestionFragment, unknown>;
export const FrontpageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Frontpage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"result"},"name":{"kind":"Name","value":"frontpage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"Question"}}]}}]}},...QuestionFragmentDoc.definitions]} as unknown as DocumentNode<FrontpageQuery, FrontpageQueryVariables>; export const FrontpageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Frontpage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"result"},"name":{"kind":"Name","value":"frontpage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"Question"}}]}}]}},...QuestionFragmentDoc.definitions]} as unknown as DocumentNode<FrontpageQuery, FrontpageQueryVariables>;
export const SearchDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Search"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SearchInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"result"},"name":{"kind":"Name","value":"searchQuestions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"Question"}}]}}]}},...QuestionFragmentDoc.definitions]} as unknown as DocumentNode<SearchQuery, SearchQueryVariables>; export const SearchDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Search"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SearchInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"result"},"name":{"kind":"Name","value":"searchQuestions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"Question"}}]}}]}},...QuestionFragmentDoc.definitions]} as unknown as DocumentNode<SearchQuery, SearchQueryVariables>;

View File

@ -15,6 +15,13 @@ fragment Question on Question {
qualityIndicators { qualityIndicators {
stars stars
numForecasts numForecasts
numForecasters
volume
spread
sharesVolume
openInterest
liquidity
tradeVolume
} }
visualization visualization
} }