Skip to content

Commit

Permalink
Fix type definition for Resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalp committed Dec 13, 2018
1 parent 2ebb8e7 commit 217a999
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/python/typing/issues/264
Resolver = Callable[..., Any]

ScalarOperation = Callable[[Any], Any]

0 comments on commit 217a999

Please sign in to comment.