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 support for calculating cost based on args #6

Open
chirag04 opened this issue Jun 26, 2017 · 3 comments
Open

add support for calculating cost based on args #6

chirag04 opened this issue Jun 26, 2017 · 3 comments

Comments

@chirag04
Copy link
Contributor

No description provided.

@ivome
Copy link

ivome commented Aug 2, 2017

I tried to add that to this package here but ended up building my own validator that has support for args, variables and custom settings per field, similar to the implementation of the sangria library: https://github.com/ivome/graphql-query-complexity

@chirag04
Copy link
Contributor Author

chirag04 commented Aug 2, 2017

neat!

@taion
Copy link
Contributor

taion commented Apr 12, 2019

With Apollo Server, creating a new validation rule per request is tricky. In general, it's also not easy to get the relevant variables for a batch request.

I'm going to instead build this as a per-request (in batch) extension that sets variables onto a singleton before and after the validation phase.

This should be okay, given that validation is synchronous anyway.

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

3 participants