Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add history to the graphql API #64

Closed
NunoSempere opened this issue Apr 22, 2022 · 2 comments
Closed

Add history to the graphql API #64

NunoSempere opened this issue Apr 22, 2022 · 2 comments
Assignees

Comments

@NunoSempere
Copy link
Collaborator

NunoSempere commented Apr 22, 2022

Right now, history isn't yet added to the graphql API. But it seems like a natural next step.

@berekuk
Copy link
Collaborator

berekuk commented Apr 27, 2022

Done: https://metaforecast.org/api/graphql?query=fragment+Question+on+Question+%7B%0A++id%0A++url%0A++title%0A++description%0A++timestamp%0A++options+%7B%0A++++name%0A++++probability%0A++%7D%0A++platform+%7B%0A++++id%0A++++label%0A++%7D%0A++qualityIndicators+%7B%0A++++stars%0A++++numForecasts%0A++%7D%0A++visualization%0A++history+%7B%0A++++timestamp%0A++++options+%7B%0A++++++name%0A++++++probability%0A++++%7D%0A++%7D%0A%7D%0A%0Aquery+Frontpage+%7B%0A++result%3A+frontpage+%7B%0A++++...Question%0A++%7D%0A%7D

I'm not sure if this is the best approach in terms of API design & implementation, but it's the easiest one for now. Probably going to be too slow if we'll want to serve history graphs for a page full of different questions, but good enough for a single question's page. I haven't tried to benchmark it yet.

Other notes:

@berekuk berekuk closed this as completed Apr 27, 2022
@NunoSempere
Copy link
Collaborator Author

Beautiful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants