Skip to content

Commit

Permalink
Merge pull request #79 from mirumee/fix-resolver-type-definition
Browse files Browse the repository at this point in the history
Fix type definition for Resolver
  • Loading branch information
rafalp committed Dec 13, 2018
2 parents 2ebb8e7 + caa439c commit c761566
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ariadne/types.py
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]

0 comments on commit c761566

Please sign in to comment.