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

feat: add query complexity and depth support in server directive #2828

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from

Conversation

laststylebender14
Copy link
Contributor

@laststylebender14 laststylebender14 commented Sep 16, 2024

Summary:
documentation update pull request: tailcallhq/tailcallhq.github.io#492

Issue Reference(s):
Fixes #2725

Build & Testing:

  • I ran cargo test successfully.
  • I have run ./lint.sh --mode=fix to fix all linting issues raised by ./lint.sh --mode=check.

Checklist:

  • I have added relevant unit & integration tests.
  • I have updated the documentation accordingly.
  • I have performed a self-review of my code.
  • PR follows the naming convention of <type>(<optional scope>): <title>

@laststylebender14 laststylebender14 marked this pull request as draft September 16, 2024 08:51
@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Sep 16, 2024
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.27%. Comparing base (87c4c7c) to head (5cd51b8).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2828      +/-   ##
==========================================
+ Coverage   87.13%   87.27%   +0.14%     
==========================================
  Files         254      257       +3     
  Lines       25144    25343     +199     
==========================================
+ Hits        21910    22119     +209     
+ Misses       3234     3224      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@laststylebender14 laststylebender14 marked this pull request as ready for review September 16, 2024 16:11
@laststylebender14 laststylebender14 changed the title feat: add query complexity and depth feat: add query complexity and depth support in server directive Sep 16, 2024
.when(self.index.query_depth().is_some()),
)
.validate(&plan)
.to_result()?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Store the computed query depth in the plan. The builder should not fail if depth or complexity thresholds are exceeded.

}
}

impl ExecutionRule for QueryDepth {
Copy link
Contributor

Choose a reason for hiding this comment

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

ExecutionRule is basically Transform with Value = OperationPlan and Error = String. Let's reuse it here.

@tusharmath tusharmath marked this pull request as draft September 21, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Brand new functionality, features, pages, workflows, endpoints, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Query complexity and depth
2 participants