-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from mirumee/fix-resolver-type-definition
Fix type definition for Resolver
- Loading branch information
Showing
1 changed file
with
5 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
from typing import Any, Callable | ||
from typing_extensions import Protocol | ||
|
||
from graphql.type import GraphQLResolveInfo, GraphQLSchema | ||
from graphql.type import GraphQLSchema | ||
|
||
|
||
class Bindable(Protocol): | ||
def bind_to_schema(self, schema: GraphQLSchema) -> None: | ||
pass # pragma: no cover | ||
|
||
|
||
Resolver = Callable[[Any, GraphQLResolveInfo], Any] | ||
# Note: this should be [Any, GraphQLResolveInfo, **kwargs], | ||
# but this is not achieveable with python types yet: | ||
# https://github.com/mirumee/ariadne/pull/79 | ||
Resolver = Callable[..., Any] | ||
|
||
ScalarOperation = Callable[[Any], Any] |