quantified-uncertainty / metaforecast

Fetch forecasts from prediction markets/forecasting platforms to make them searchable. Integrate these forecasts into other services.
https://metaforecast.org/
MIT License
57 stars 5 forks source link

REST or GraphQL? #6

Closed berekuk closed 2 years ago

berekuk commented 2 years ago

If we do #4 then API might not even be necessary right now (it's necessary for in-page operations, but not for the single page data fetching).

So, do we even want REST API if we expect to eventually grow to GraphQL (which is also self-documented, which is a nice bonus)?

I could implement a rudimentary GraphQL endpoint which covers everything from https://github.com/QURIresearch/metaforecast-api-server/blob/master/index.js in a day or two, in case we want to share any kind of API for third-party clients ASAP.

Supporting both REST and GraphQL is a possibility too, but more costly in maintenance in the long run. So this depends on how many API clients we're expecting to get and how much effort we can afford to put into making the life easier for them (things to consider: backward compatibility, documentation, feature parity between APIs and between an API and the website).

NunoSempere commented 2 years ago

Yes, I agree with you that having a GraphQL database makes sense. The current endpoints are are on alpha and it is fine to change them.

OAGr commented 2 years ago

I'm fine just doing GraphQL. I don't see the API being massively used any time soon, really don't think both are necessary.