
    CjO                     t    S SK r S SKJrJrJrJr  S SKJrJrJ	r	J
r
Jr   " S S5      rS\\\4   S\S\4S	 jrg)
    N)AnyDictOptionalUnion)DocumentNodeGraphQLSchemaSourceparse	print_astc                       \ rS rSrSrSSS.S\\S \4   S\\	\\
4      S\\   4S jjrS	\S
S 4S jr\S
\	\\
4   4S j5       rS rSrg)GraphQLRequest   zGraphQL Request to be executed.Nvariable_valuesoperation_namerequestr   r   c                   [        U[        5      (       a  [        US5      n[        U5      U l        OH[        U[
        5      (       a  Xl        O,[        U[        5      (       d  [        S[        U5       35      e[        U[        5      (       a/  UR                  U l        Uc  UR                  nUc  UR                  nX l	        X0l
        g)a  Initialize a GraphQL request.

:param request: GraphQL request as DocumentNode object or as a string.
     If string, it will be converted to DocumentNode.
:param variable_values: Dictionary of input parameters (Default: None).
:param operation_name: Name of the operation that shall be executed.
    Only required in multi-operation documents (Default: None).
:return: a :class:`GraphQLRequest <gql.GraphQLRequest>`
         which can be later executed or subscribed by a
         :class:`Client <gql.client.Client>`, by an
         :class:`async session <gql.client.AsyncClientSession>` or by a
         :class:`sync session <gql.client.SyncClientSession>`
:raises graphql.error.GraphQLError: if a syntax error is encountered.
zGraphQL requestz$Unexpected type for GraphQLRequest: N)
isinstancestrr	   r
   documentr   r   	TypeErrortyper   r   )selfr   r   r   sources        e/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/gql/graphql_request.py__init__GraphQLRequest.__init__
   s    * gs##G%67F!&MDM..#MG^44B4=/RSSg~..#,,DM&")"9"9%!(!7!79H-;    schemareturnc           
          SSK Jn  U R                  (       d   e[        U R                  U" UU R                  U R                  U R
                  S9U R
                  S9$ )N   )serialize_variable_values)r   r   r   r   r   )#utilities.serialize_variable_valuesr#   r   r   r   r   )r   r   r#   s      r   r#   (GraphQLRequest.serialize_variable_values1   sW    R####MM5 $ 4 4#22	  ..	
 		
r   c                     [        U R                  5      nSU0nU R                  (       a  U R                  US'   U R                  (       a  U R                  US'   U$ )NqueryoperationName	variables)r   r   r   r   )r   	query_strpayloads      r   r+   GraphQLRequest.payloadB   sQ    dmm,	#*I"6'+':':GO$#'#7#7GK r   c                 ,    [        U R                  5      $ )N)r   r+   )r   s    r   __str__GraphQLRequest.__str__O   s    4<<  r   )r   r   r   )__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   r   r   r   r#   propertyr+   r.   __static_attributes__ r   r   r   r      s    ) 59(,%<|%5s:;%< "$sCx.1	%<
 !%<N
 
BR 
" 
c3h 
 
!r   r   r   kwargsr    c                 j   [        U [        5      (       a%  [        R                  " S[        SS9  [        U 5      n [        U [
        5      (       d  [        S5      eUR                  SS5      nUR                  SS5      nU(       d  U(       a&  [        R                  " S[        SS9  X l        X0l	        U $ )	zThis methods is there temporarily to convert the old style of calling
execute and subscribe methods with a DocumentNode,
variable_values and operation_name arguments.
zHUsing a DocumentNode is deprecated. Please use a GraphQLRequest instead.   )
stacklevelz)request should be a GraphQLRequest objectr   Nr   zUsing variable_values and operation_name arguments of execute and subscribe methods is deprecated. Instead, please use the variable_values and operation_name properties of GraphQLRequest)
r   r   warningswarnDeprecationWarningr   r   popr   r   )r   r8   r   r   s       r   support_deprecated_requestr@   S   s     '<((* 	
 !)g~..CDDjj!2D9OZZ 0$7N.$
 		
 #2!/Nr   )r<   typingr   r   r   r   graphqlr   r   r	   r
   r   r   r@   r7   r   r   <module>rC      sJ     - - I II! I!X)></0)) )r   