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

Batching requests is not supported anymore #72

Open
leszekhanusz opened this issue Jan 2, 2024 · 5 comments
Open

Batching requests is not supported anymore #72

leszekhanusz opened this issue Jan 2, 2024 · 5 comments

Comments

@leszekhanusz
Copy link

It was working in September when we developed the functionality for the gql Python client.

Could it be possible to bring that functionality back?

In the meantime, I'm disabling those tests on our side.

@trevorblades
Copy link
Owner

Hey there! I think this was due to this API switching from Apollo Server to GraphQL Yoga a little while ago. And it seems like batching is disabled by default in Yoga: https://the-guild.dev/graphql/yoga-server/docs/features/request-batching

So I made a commit that enables it: 398df27

Hope that helps :)

@leszekhanusz
Copy link
Author

Hey, Thanks!
I notice though that it works now on the endpoint https://countries.trevorblades.workers.dev/graphql but not on https://countries.trevorblades.com/graphql
Is that normal?

@trevorblades
Copy link
Owner

Ah, I see what's going on. I recently introduced a rate limit to deal with some users abusing the API by sending 100s of uncachable, erroneous requests per second, and blowing up my Cloudflare workers free usage limit as a result. Unfortunately, batch queries is currently incompatible with Stellate's rate limiting feature: https://stellate.co/docs/graphql-rate-limiting/alpha-limitations#graph-ql-query-batching

I really want to support this feature, but I also know that unless I have another plan in place to deal with spamming requests, disabling rate limiting will cause the entire API to be unresponsive once per day, if it continues to get hammered by invalid requests.

Perhaps there's yet another (hopefully free) service I can put infront of Stellate to deal with the rate limiting issue. Would appreciate any ideas or recommendations, if you have any!

@leszekhanusz
Copy link
Author

I understand.
Sorry I don't have any recommendations.

@trevorblades
Copy link
Owner

No worries! I'll keep thinking about this and hopefully come up with a good solution soon. I'll post back here with any updates. Thanks for bringing this to my attention!

@trevorblades trevorblades reopened this Jan 3, 2024
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