
    CjA                        % S SK JrJrJrJrJrJr  SSKJr  SSK	J
r
JrJr  SSKJr  SSKJrJr  SSKJrJr  SSKJrJr  S	S
KJr  S	SKJrJr  S	SKJrJr  / SQr " S S\ 5      r!\RD                  " 5        V Vs0 s H  u  pU \#" S U 5       5      _M     snn r$\\%\\%S4   4   \&S'      SS\S\
S\\\\         S\\'   S\\   S\\   4S jjr(  S S\
S\\   S\\\\         S\\   4S jjr)S\
SS4S jr*S\
S\SS4S jr+gs  snn f )!    )
CollectionDictListOptionalTupleType   )GraphQLError)DocumentNodeParallelVisitorvisit)QUERY_DOCUMENT_KEYS)inspectis_collection)GraphQLSchemaassert_valid_schema)TypeInfoTypeInfoVisitor   )ASTValidationRule)specified_rulesspecified_sdl_rules)SDLValidationContextValidationContext)assert_valid_sdlassert_valid_sdl_extensionvalidatevalidate_sdlc                       \ rS rSrSrSrg)ValidationAbortedError   z?Error when a validation has been aborted (error limit reached). N)__name__
__module____qualname____firstlineno____doc____static_attributes__r"       m/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/graphql/validation/validate.pyr    r       s    Ir)   r    c              3   4   #    U  H  oS :w  d  M
  Uv   M     g7f)descriptionNr"   ).0keys     r*   	<genexpr>r/      s     <tm';ts   		.query_document_keys_to_validateNschemadocument_astrules
max_errors	type_inforeturnc           	        ^^	 U(       a  [        U[        5      (       d  [        S5      e[        U 5        Tc  SmO [        T[        5      (       d  [        S5      eUc  [        U 5      nO-[        U[
        5      (       d  [        S[        U5       S35      eUc  [        nO2[        U5      (       a  [        S U 5       5      (       d  [        S5      e/ m	S	[        S
S4U	U4S jjn[        XXE5      nU Vs/ s H
  ow" U5      PM     nn [        U[        U[        U5      5      [        5        T	$ s  snf ! [          a     T	$ f = f)a  Implements the "Validation" section of the spec.

Validation runs synchronously, returning a list of encountered errors, or an empty
list if no errors were encountered and the document is valid.

A list of specific validation rules may be provided. If not provided, the default
list of rules defined by the GraphQL specification will be used.

Each validation rule is a ValidationRule object which is a visitor object that holds
a ValidationContext (see the language/visitor API). Visitor methods are expected to
return GraphQLErrors, or lists of GraphQLErrors when invalid.

Validate will stop validation after a ``max_errors`` limit has been reached.
Attackers can send pathologically invalid queries to induce a DoS attack,
so by default ``max_errors`` set to 100 errors.

Providing a custom TypeInfo instance is deprecated; omit the ``type_info``
argument so that validate creates the TypeInfo instance. It will be removed in v3.3.
zMust provide document.Nd   z6The maximum number of errors must be passed as an int.zNot a TypeInfo object: .c              3   p   #    U  H,  n[        U[        5      =(       a    [        U[        5      v   M.     g 7fN)
isinstancetype
issubclassr   )r-   rules     r*   r/   validate.<locals>.<genexpr>D   s+      -SX4
4F:d4E#FFSXs   46zHRules must be specified as a collection of ASTValidationRule subclasses.errorr6   c                    > [        T5      T:  a   TR                  [        S5      5        [        eTR                  U 5        g )NzDToo many validation errors, error limit reached. Validation aborted.)lenappendr
   r    )rA   errorsr4   s    r*   on_errorvalidate.<locals>.on_errorM   s<    v;*$MM+ )(er)   )r<   r   	TypeErrorr   intr   r   r   r   allr
   r   r   r   r   r0   r    )
r1   r2   r3   r4   r5   rF   contextr?   visitorsrE   s
      `     @r*   r   r      sR   4 z,EE011

C((PQQV$		8,,1')2D1EQGHH}5!! -SX- * * V
 	
 "$F	 	 	 	  iJG +00%$W%H0Ix'@A+	
 M 1 " Ms   6D0
$D5 5
EEschema_to_extendc                     / n[        XUR                  5      nUc  [        nU Vs/ s H
  oU" U5      PM     nn[        U [	        U5      5        U$ s  snf )z2Validate an SDL document.

For internal use only.
)r   rD   r   r   r   )r2   rM   r3   rE   rK   r?   rL   s          r*   r   r   j   sT     "$F"<6==QG}#*/0%$W%H0	,12M 1s   Ac                 j    [        U 5      nU(       a!  [        SR                  S U 5       5      5      eg)z}Assert document is valid SDL.

Utility function which asserts a SDL document is valid by throwing an error if it
is invalid.


c              3   8   #    U  H  oR                   v   M     g 7fr;   messager-   rA   s     r*   r/   #assert_valid_sdl.<locals>.<genexpr>        #FveMMv   Nr   rH   join)r2   rE   s     r*   r   r   |   s0     ,'F#Fv#FFGG r)   c                 j    [        X5      nU(       a!  [        SR                  S U 5       5      5      eg)zAssert document is a valid SDL extension.

Utility function which asserts a SDL document is valid by throwing an error if it
is invalid.
rP   c              3   8   #    U  H  oR                   v   M     g 7fr;   rR   rT   s     r*   r/   -assert_valid_sdl_extension.<locals>.<genexpr>   rV   rW   NrX   )r2   r1   rE   s      r*   r   r      s0     ,/F#Fv#FFGG r)   )NNN)NN),typingr   r   r   r   r   r   rA   r
   languager   r   r   language.astr   pyutilsr   r   r=   r   r   	utilitiesr   r   r3   r   r   r   validation_contextr   r   __all__RuntimeErrorr    itemstupler0   str__annotations__rI   r   r   r   r   )kindkeyss   00r*   <module>rk      s   @ @ @   ; ; . , 5 1 $ A G
XJ\ J *//1?1
 	%<t<
<<1? c5c?&:!;  <@ $$(KKK Jt$5678K 	K
 !K 
,K` 15;?}- Jt$5678 
,	$	H< 	HD 	HHH(5H	He?s   9D