
    Cj	                         S SK JrJr  S SKJr  S SKJrJrJrJ	r	J
r
JrJr  S/r\S\4   r " S S5      rS\
\S4   S\\   4S	 jrg
)    )partialreduce)
isfunction)CallableIteratorDictListTupleAnyOptionalMiddlewareManager.c                   h    \ rS rSr% SrSr\\\4   \S'   \	\
\      \S'   S\4S jrS\S	\4S
 jrSrg)r      a  Manager for the middleware chain.

This class helps to wrap resolver functions with the provided middleware functions
and/or objects. The functions take the next middleware function as first argument.
If middleware is provided as an object, it must provide a method ``resolve`` that is
used as the middleware function.

Note that since resolvers return "AwaitableOrValue"s, all middleware functions
must be aware of this and check whether values are awaitable before awaiting them.
)__dict__middlewares_middleware_resolvers_cached_resolversr   r   r   c                 b    Xl         U(       a  [        [        U5      5      OS U l        0 U l        g N)r   listget_middleware_resolversr   r   )selfr   s     n/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/graphql/execution/middleware.py__init__MiddlewareManager.__init__   s,    &;FD)+67D 	" "$    field_resolverreturnc                     U R                   c  U$ XR                  ;  a%  [        S U R                   U5      U R                  U'   U R                  U   $ )zWrap the provided resolver with the middleware.

Returns a function that chains the middleware functions with the provided
resolver function.
c                     [        X5      $ r   )r   )chained_fnsnext_fns     r   <lambda>6MiddlewareManager.get_field_resolver.<locals>.<lambda>0   s	    WW-Jr   )r   r   r   )r   r   s     r   get_field_resolver$MiddlewareManager.get_field_resolver$   sY     %%-!!!7!775;J**6D"">2
 %%n55r   )r   r   r   N)__name__
__module____qualname____firstlineno____doc__	__slots__r   GraphQLFieldResolver__annotations__r   r	   r   r   r   r%   __static_attributes__ r   r   r   r      sQ    	 XI02FFGG#DN33$S $626	6r   r   r   c              #   v   #    U  H/  n[        U5      (       a  Uv   M  [        USS5      nUc  M+  Uv   M1     g7f)zEGet a list of resolver functions from a list of classes or functions.resolveN)r   getattr)r   
middlewareresolver_funcs      r   r   r   7   s:     !
j!!#J	4@M(## "s   *9	9N)	functoolsr   r   inspectr   typingr   r   r   r	   r
   r   r   __all__r-   r   r   r0   r   r   <module>r:      sV    %  G G G
S) )6 )6X$%S/ $hx>P $r   