
    XjS                        d dl mZmZmZmZmZmZ ddlmZm	Z	m
Z
mZmZ ddlmZmZmZmZmZmZ ddlmZ ddlmZ dd	gZd
edeee	f   deeef   dededeeee   f   fdZd
edeee	f   deeef   dedee   deeee   f   fdZd
edeee	f   deeef   dededeeee   f   dee   ddfdZdeeef   dee
eef   defdZd
edee	ef   dedefdZdedefdZ y)    )AnyDictListSetUnioncast   )	FieldNodeFragmentDefinitionNodeFragmentSpreadNodeInlineFragmentNodeSelectionSetNode)GraphQLAbstractTypeGraphQLIncludeDirectiveGraphQLObjectTypeGraphQLSchemaGraphQLSkipDirectiveis_abstract_type)type_from_ast   )get_directive_valuescollect_fieldscollect_sub_fieldsschema	fragmentsvariable_valuesruntime_typeselection_setreturnc           
      <    i }t        | |||||t                      |S )a;  Collect fields.

    Given a selection_set, collects all the fields and returns them.

    collect_fields requires the "runtime type" of an object. For a field that
    returns an Interface or Union type, the "runtime type" will be the actual
    object type returned by that field.

    For internal use only.
    )collect_fields_implset)r   r   r   r   r   fieldss         m/var/www/html/myl_app/scheduler-service/venv/lib/python3.12/site-packages/graphql/execution/collect_fields.pyr   r      s+    " *,F	?L-QTQV M    return_typefield_nodesc           
      |    i }t               }|D ]*  }|j                  st        | ||||j                  ||       , |S )ar  Collect sub fields.

    Given a list of field nodes, collects all the subfields of the passed in fields,
    and returns them at the end.

    collect_sub_fields requires the "return type" of an object. For a field that
    returns an Interface or Union type, the "return type" will be the actual
    object type returned by that field.

    For internal use only.
    )r"   r   r!   )r   r   r   r&   r'   sub_field_nodesvisited_fragment_namesnodes           r$   r   r   0   sT    $ 35O'*u 
""&
 r%   r#   r*   Nc           
      T   |j                   D ]  }t        |t              r:t        ||      s!t	        |      }|j                  |g       j                  |       Nt        |t              r6t        ||      rt        | ||      sxt        | ||||j                  ||       t        |t              s|j                  j                  }	|	|v st        ||      s|j                  |	       |j                  |	      }
|
rt        | |
|      st        | ||||
j                  ||        y)z)Collect fields (internal implementation).N)
selections
isinstancer
   should_include_nodeget_field_entry_key
setdefaultappendr   does_fragment_condition_matchr!   r   r   namevalueaddget)r   r   r   r   r   r#   r*   	selectionr4   	frag_namefragments              r$   r!   r!   R   s-    #-- (	i+&	B&y1DdB'..y9	#56&269lS''& 	#56!,,I22:M; "&&y1 }}Y/H#@,$ &&&A(r%   r+   c                 h    t        t        ||       }|r|d   ryt        t        ||       }|r|d   syy)zCheck if node should be included

    Determines if a field should be included based on the @include and @skip
    directives, where @skip has higher precedence than @include.
    ifFT)r   r   r   )r   r+   skipincludes       r$   r/   r/      s=       4dOLDT
"#:D/RGwt}r%   r:   type_c                     |j                   }|syt        | |      }||u ryt        |      r | j                  t	        t
        |      |      S y)z8Determine if a fragment is applicable to the given type.TF)type_conditionr   r   is_sub_typer   r   )r   r:   r?   type_condition_nodeconditional_types        r$   r3   r3      sW     #11$V-@A5 ()!!$':<L"MuUUr%   c                 r    | j                   r| j                   j                  S | j                  j                  S )z@Implements the logic to compute the key of a given field's entry)aliasr5   r4   )r+   s    r$   r0   r0      s%    #zz4::>tyy>r%   )!typingr   r   r   r   r   r   languager
   r   r   r   r   typer   r   r   r   r   r   utilities.type_from_astr   valuesr   __all__strr   r   r!   boolr/   r3   r0    r%   r$   <module>rP      s   4 4   4 (1
2C//0 #s(^ $	
 $ 
#tI
0C//0 #s(^ #	
 i 
#tI
D22C//02 #s(^2 $	2
 $2 d9o%&2  H2 
2j#s(^
"I/AA
B 
(*,>>?  
	"?i ?C ?r%   