-
-
Notifications
You must be signed in to change notification settings - Fork 541
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 SchemaExtension.should_await
#3724
base: main
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis PR introduces a new Class diagram for SchemaExtension with should_await methodclassDiagram
class SchemaExtension {
+on_execute()
+resolve(_next: Callable)
+should_await(_next: Callable) bool
}
note for SchemaExtension "The should_await method determines if the extension should await the result from next based on the _is_async attribute."
Class diagram for SchemaConverter with _is_async attributeclassDiagram
class SchemaConverter {
+from_scalar(scalar: Type) GraphQLScalarType
+_async_resolver
+_resolver
}
class _async_resolver {
+_is_default: bool
+_is_async: bool
}
class _resolver {
+_is_default: bool
+_is_async: bool
}
SchemaConverter --> _async_resolver
SchemaConverter --> _resolver
note for _async_resolver "The _is_async attribute is set to True if the field is async."
note for _resolver "The _is_async attribute is set to False if the field is not async."
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @patrick91 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Hi, thanks for contributing to Strawberry 🍓! We noticed that this PR is missing a So as soon as this PR is merged, a release will be made 🚀. Here's an example of Release type: patch
Description of the changes, ideally with some examples, if adding a new feature. Release type can be one of patch, minor or major. We use semver, so make sure to pick the appropriate type. If in doubt feel free to ask :) Here's the tweet text:
|
CodSpeed Performance ReportMerging #3724 will not alter performanceComparing Summary
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3724 +/- ##
==========================================
- Coverage 97.01% 97.01% -0.01%
==========================================
Files 502 502
Lines 33521 33525 +4
Branches 5598 5598
==========================================
+ Hits 32522 32525 +3
- Misses 793 794 +1
Partials 206 206 |
a29b9be
to
0137998
Compare
3a927dc
to
8fb12e7
Compare
Description
Types of Changes
Issues Fixed or Closed by This PR
Checklist
Summary by Sourcery
Add the
should_await
method to theSchemaExtension
class to optimize asynchronous execution checks by using a custom_is_async
attribute. Update tests to reflect this change.New Features:
should_await
method in theSchemaExtension
class to determine if the result from the next callable should be awaited.Enhancements:
_is_async
attribute instead ofinspect.isawaitable
.Tests:
should_await
method in theResolveExtension
class.