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

copy complexity to RequestContext #403

Merged
merged 3 commits into from
Nov 2, 2018
Merged

copy complexity to RequestContext #403

merged 3 commits into from
Nov 2, 2018

Conversation

vvakame
Copy link
Collaborator

@vvakame vvakame commented Oct 29, 2018

I want to get access to operation complexity on Tracing.

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)

@vvakame vvakame requested a review from vektah October 29, 2018 09:56
@vvakame
Copy link
Collaborator Author

vvakame commented Oct 29, 2018

I want to see the complexity of each path, but it looks difficult 🤔

@@ -17,6 +17,10 @@ type RequestContext struct {
RawQuery string
Variables map[string]interface{}
Doc *ast.QueryDocument

ComplexityLimit int
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is ComplexityLimit here, its static?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes it's static value determined at compile time.

BTW, I want to modify it on run time...

Copy link
Collaborator

Choose a reason for hiding this comment

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

BTW, I want to modify it on run time...

🤔

when? ideally a request over the limit doesn't run anything, especially not in the resolver stack.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For example, If we want to change ComplexityLimit between 1st party client and 3rd party client.

@vvakame vvakame mentioned this pull request Nov 2, 2018
2 tasks
@vektah vektah merged commit 926ad17 into master Nov 2, 2018
@vektah vektah deleted the feat-complexity branch November 2, 2018 04:26
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
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.

2 participants