o
    tBh                     @   s  d dl mZmZmZmZmZmZ ddlmZm	Z	 ddl
mZ dgZe	dded	ed
eeeef  defddZe		ddee d	ed
eeeef  dee fddZe		dde	d	ed
eeeef  defddZ	dded	ed
eeeef  defddZdS )    )Any
CollectionDictListOptionaloverload   )NodeOperationType)is_iterableast_to_dictFNnode	locationscachereturnc                 C      d S N r   r   r   r   r   t/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/graphql/utilities/ast_to_dict.pyr   	   s   c                 C   r   r   r   r   r   r   r   r         c                 C   r   r   r   r   r   r   r   r      r   c                    s   t trB du ri  n v r  S i   < }| fdddjdd  D  r@j}|r@t|j|jd|d< |S trP fdd	D S t t	rXj
S S )
z~Convert a language AST to a nested Python dictionary.

    Set `locations` to True in order to get the locations as well.
    Nc                    s    i | ]}|t t| qS r   )r   getattr).0keyr   r   r   r   r   
<dictcomp>-   s    zast_to_dict.<locals>.<dictcomp>)kind   )startendlocc                    s   g | ]}t | qS r   )r   )r   sub_node)r   r   r   r   
<listcomp>8   s    zast_to_dict.<locals>.<listcomp>)
isinstancer	   updatekeysr    dictr   r   r   r
   value)r   r   r   resr    r   r   r   r      s*   

)FN)typingr   r   r   r   r   r   languager	   r
   pyutilsr   __all__boolr   strr   r   r   r   <module>   sb     