-
-
Notifications
You must be signed in to change notification settings - Fork 744
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 IBM cost analysis #7146
Merged
Merged
Add IBM cost analysis #7146
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qodana for .NETIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
michaelstaib
reviewed
Jun 6, 2024
src/HotChocolate/CostAnalysis/src/CostAnalysis/Attributes/ListSizeAttribute.cs
Outdated
Show resolved
Hide resolved
michaelstaib
reviewed
Jun 6, 2024
src/HotChocolate/CostAnalysis/src/CostAnalysis/CostAnalysisMiddleware.cs
Outdated
Show resolved
Hide resolved
michaelstaib
reviewed
Jun 6, 2024
src/HotChocolate/CostAnalysis/src/CostAnalysis/CostAnalysisMiddleware.cs
Outdated
Show resolved
Hide resolved
michaelstaib
reviewed
Jun 7, 2024
src/HotChocolate/CostAnalysis/src/CostAnalysis/Attributes/CostAttribute.cs
Outdated
Show resolved
Hide resolved
michaelstaib
reviewed
Jun 7, 2024
src/HotChocolate/CostAnalysis/src/CostAnalysis/CostAnalysisOptions.cs
Outdated
Show resolved
Hide resolved
...olate/CostAnalysis/src/CostAnalysis/DescriptorExtensions/CostArgumentDescriptorExtensions.cs
Outdated
Show resolved
Hide resolved
...olate/CostAnalysis/src/CostAnalysis/DescriptorExtensions/CostEnumTypeDescriptorExtensions.cs
Outdated
Show resolved
Hide resolved
...ate/CostAnalysis/src/CostAnalysis/DescriptorExtensions/CostInputFieldDescriptorExtensions.cs
Outdated
Show resolved
Hide resolved
...te/CostAnalysis/src/CostAnalysis/DescriptorExtensions/CostObjectFieldDescriptorExtensions.cs
Outdated
Show resolved
Hide resolved
...ate/CostAnalysis/src/CostAnalysis/DescriptorExtensions/CostObjectTypeDescriptorExtensions.cs
Outdated
Show resolved
Hide resolved
...ate/CostAnalysis/src/CostAnalysis/DescriptorExtensions/CostScalarTypeDescriptorExtensions.cs
Outdated
Show resolved
Hide resolved
...ostAnalysis/src/CostAnalysis/DescriptorExtensions/ListSizeObjectFieldDescriptorExtensions.cs
Outdated
Show resolved
Hide resolved
src/HotChocolate/CostAnalysis/src/CostAnalysis/Properties/InternalsVisibleTo.cs
Outdated
Show resolved
Hide resolved
src/HotChocolate/CostAnalysis/src/CostAnalysis/RequestExecutorBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
michaelstaib
force-pushed
the
main
branch
2 times, most recently
from
June 17, 2024 17:49
8a97a79
to
e2d2300
Compare
github-actions
bot
added
📚 documentation
This issue is about working on our documentation.
🌶️ strawberry shake
labels
Jun 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
📚 documentation
This issue is about working on our documentation.
🌶️ hot chocolate
🧰 maintenance
🌶️ strawberry shake
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of the changes (Less than 80 chars)
❓ Questions
What am I doing wrong with the error handling in
CostAnalysisMiddleware
? It doesn't end the request. It's probably something silly. [@michaelstaib]Is it important that a fragment definition is visited after it is spread? If you spread it twice, it is only visited once.
query.examples.example1Field2[0].~fragment1~~fragment1.@example
by default instead of just~~fragment1.@example
(the fragment definition starts at the root). Would changing this break things?For unnamed operations, I've used
o.Operation.ToString().ToLowerInvariant()
for the path element – is that okay? ✅query
for an unnamed query, etc.For fragment spreads with no
TypeCondition
, I've usedcontext.OutputFields.Peek().Type.TypeName()
– is that okay?How do we avoid requiring the developer to add a
@listSize
directive to every single list in their project? Could we somehow attach this directive to connection types by default? [@michaelstaib]RequireOneSlicingArgument
would have to be set tofalse
, otherwise the user would be forced to specifyfirst
orlast
.Should we support
introspectionOnly
? (https://ibm.github.io/graphql-specs/cost-spec.html#sec-introspectionOnly) [@michaelstaib]Should we support
NoSchemaIntrospectionCustomRule
? (https://ibm.github.io/graphql-specs/cost-spec.html#sec-NoSchemaIntrospectionCustomRule) - yesFor the
CostMetrics
cache, how much memory can we use, what should the default cache size be, etc.? - we deal with that in a later prI used the
NonBacktracking
option for the introspection regexes to reduce the chance of performance issues – should I keep this, or allow backtracking? - keep it!Is there a better way to handle optional value-typed attribute arguments in
ListSizeAttribute
(forAssumedSize
)? Currently using a nullable backing field. - looks goodShould we sort the fieldCostByLocation / typeCostByLocation by key (path)? - lets skip it and check if people have an issue with it
I've not yet done anything with
@skip
/@include
. I wonder if supporting static true/false is worth it? lets revisit this for the december release✅ To-do:
Support scalars (blocked by Adding directives to custom scalar types #1380)💡 Ideas
@listSize
)🛠️ FIXMEs: 6.
(search for
FIXME
insrc/HotChocolate/CostAnalysis/
)