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

can disable expensive suggestions #517

Merged
merged 1 commit into from
Oct 6, 2020
Merged

can disable expensive suggestions #517

merged 1 commit into from
Oct 6, 2020

Conversation

yanns
Copy link
Contributor

@yanns yanns commented Oct 5, 2020

By overriding the default QueryValidator, one can disable or add a cache for the suggested fields.
Fixes #497

By overriding the default QueryValidator, one can disable or add a cache for the suggested fields.
Fixes #497
Copy link
Contributor

@agourlay agourlay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice way to avoid the problem 👍

@yanns yanns merged commit b003439 into master Oct 6, 2020
@yanns yanns deleted the expensive_suggestions branch October 6, 2020 06:21
@kiranbayram
Copy link

This looks good 👏 , any information on when this will be released ?

@yanns
Copy link
Contributor Author

yanns commented Oct 6, 2020

https://github.com/sangria-graphql/sangria/releases/tag/v2.0.1

@yanns
Copy link
Contributor Author

yanns commented Dec 22, 2020

How to disable expensive suggestions:

  val queryValidationRules = QueryValidator.allRules.map {
    case _: KnownTypeNames => new KnownTypeNames(suggestion = SuggestionFunction.Disabled)
    case o => o
  }

  val executor = Executor(
    queryValidator = ruleBased(queryValidationRules),
    [...]
  )

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

Successfully merging this pull request may close these issues.

Expensive suggestions in UnknownTypeViolation
3 participants