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

Complexity plugin support #14

Open
MichalLytek opened this issue Oct 12, 2020 · 2 comments
Open

Complexity plugin support #14

MichalLytek opened this issue Oct 12, 2020 · 2 comments
Labels
enhancement New feature or request priority:low This issue has a low priority and will be done after all the others question Further information is requested

Comments

@MichalLytek
Copy link
Owner

@MichalLytek I have been playing around with the code base and have been testing two new features that might be nice in typegraphql-prisma.

  • Complexity plugin support
  • Default value for take (required to properly determine complexity)

Together these can prevent memory overflow high CPU utilization by limiting how complex queries can be which is extremely useful when you have large databases.

Originally posted by @wSedlacek in #1 (comment)

@MichalLytek
Copy link
Owner Author

@wSedlacek

How would you want to use the complexity plugin?
In normal TypeGraphQL you manually annotate every field or input/object/args type with the @Complexity decorator.

Do you use some more model-based approach? Like annotate only model field and then use the same value for every field-related things like sort args, etc.?

@MichalLytek MichalLytek added enhancement New feature or request question Further information is requested labels Oct 12, 2020
@Jonasdoubleyou
Copy link

For those interested, I've implemented some very rudimentary complexity limitation, which basically enforces take to be present in where queries, and multiplies the cardinality in nested resolvers. Code can be found here. So far this has worked quite well.

@MichalLytek MichalLytek added the priority:low This issue has a low priority and will be done after all the others label Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority:low This issue has a low priority and will be done after all the others question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants