Skip to content

Commit

Permalink
Allow user to pass in a custom resolve info context type (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ted Zadniprovskyi committed Feb 20, 2024
1 parent e256148 commit ae97307
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/graphql/type/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,9 @@ def to_kwargs(self) -> GraphQLFieldKwargs:
def __copy__(self) -> GraphQLField: # pragma: no cover
return self.__class__(**self.to_kwargs())

TContext = TypeVar("TContext")

class GraphQLResolveInfo(NamedTuple):
class GraphQLResolveInfo(Generic[TContext], NamedTuple):
"""Collection of information passed to the resolvers.
This is always passed as the first argument to the resolvers.
Expand Down

0 comments on commit ae97307

Please sign in to comment.