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

Ability to get names of all the stitched queries in a middleware #5758

Open
tars-a opened this issue Dec 8, 2023 · 0 comments
Open

Ability to get names of all the stitched queries in a middleware #5758

tars-a opened this issue Dec 8, 2023 · 0 comments

Comments

@tars-a
Copy link

tars-a commented Dec 8, 2023

I am trying to implement a rate limiter for my GraphQL server. The way I am implementing is that each query will be mapped (by its name) to a rate limit configuration. This enables me to configure each GraphQL query differently to throttle it.

Using the info object in a middleware, I was able to get the name of the main query, but I was not able to see the name of the stitched query (or queries).

If there was a way to get the name of the stitched queries from info object, or, via any other mechanism, it'd be good.

So, I have checked the documentation, tried info object in the middleware. Nothing has worked for me, so far.

Example:

{
  locations {
    name
    reviewsForLocation {
      rating
    }
  }
}

Here, the main query is locations and the stitched query is reviewsForLocation. I'd like to get the name of both the queries (types) in the middleware.

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

1 participant