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

Api not working #46

Closed
NunoSempere opened this issue Apr 5, 2022 · 4 comments
Closed

Api not working #46

NunoSempere opened this issue Apr 5, 2022 · 4 comments

Comments

@NunoSempere
Copy link
Collaborator

Right now, https://metaforecast.org/api/questions returns

{
  "errorMessage": "Response payload size exceeded maximum allowed payload size (6291556 bytes).",
  "errorType": "Function.ResponseSizeTooLarge"
}

My guess is that this issue is kinda unavoidable, because the api fetches stuff on the server side. I'm thinking we might want to go back to api.metaforecast.org. Not sure how using graphql changes this.

@berekuk
Copy link
Collaborator

berekuk commented Apr 5, 2022

Huh.

Opinions:

  • any API needs some limits; if graphql wasn't coming (I hope to finish the first iteration by the end of next week), I'd propose to just implement some kind of pagination
  • I can add a pager anyway if there are any users of this API route, it's not a big deal; should I do this?
  • on api.metaforecast.org: separate domain seems like an implementation detail to me which would be better to hide from the users; I'd still prefer to stay with /api for this reason if possible (and also to avoid CORS-related issues)

How urgent is this? I'd like to figure out #44 first, since one of its outcomes might be "let's just leave Netlify".

@NunoSempere
Copy link
Collaborator Author

This is not really urgent, and a bit moot with the coming graphql

  • Separate domain doesn't seem like an implementation detail. In particular, irrc, calls through the /api route are fetched server side in nextjs, which means that we can't exceed the netlify/vercel limits.

@berekuk
Copy link
Collaborator

berekuk commented Apr 8, 2022

Separate domain doesn't seem like an implementation detail

I meant "an implementation detail for the end user" (our infrastructure decisions shouldn't affect the urls, otherwise users would have to switch if we change our setup), but I'm nitpicking, sorry.

I still believe that paging + Vercel (#52) would solve all our current pains and I'd prefer to avoid a separate DO-hosted domain if possible. In particular, branch preview urls for API might be useful in the future, since APIs and React code often change in lockstep.

@berekuk
Copy link
Collaborator

berekuk commented Apr 22, 2022

/api/questions is no more, API consumers should use GraphQL questions query which implements paging.

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