o
    tBh]                     @   s   U d dl mZmZ d dl mZ d dlmZ d dlmZm	Z	 dgZ
ddejejejgdd	d
ddddddddgdZe	ed< ddejejejgddd
ddddddddgdZe	ed< dedefddZdS )    )GraphQLSchemaIntrospectionQuery)build_client_schema)inspect)DirectiveLocationIntrospectionDirectiver   includez[Directs the executor to include this field or fragment only when the `if` argument is true.ifzIncluded when true.NON_NULLNoneSCALARBoolean)kindnameofType)r   descriptiontypedefaultValue)r   r   	locationsargsINCLUDE_DIRECTIVE_JSONskipzSDirects the executor to skip this field or fragment when the `if` argument is true.zSkipped when true.SKIP_DIRECTIVE_JSONintrospectionreturnc                 C   s   t | trt | dtstdt|  d| d }|dd}|du r+g  |d< }tdd |D s9|t tdd |D sG|t t	| d	d
S )a  This is an alternative to the graphql-core function
    :code:`build_client_schema` but with default include and skip directives
    added to the schema to fix
    `issue #278 <https://github.com/graphql-python/gql/issues/278>`_

    .. warning::
        This function will be removed once the issue
        `graphql-js#3419 <https://github.com/graphql/graphql-js/issues/3419>`_
        has been fixed and ported to graphql-core so don't use it
        outside gql.
    __schemazInvalid or incomplete introspection result. Ensure that you are passing the 'data' attribute of an introspection response and no 'errors' were returned alongside: .
directivesNc                 s       | ]	}|d  dkV  qdS )r   r   N .0	directiver   r   x/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/gql/utilities/build_client_schema.py	<genexpr>\       z&build_client_schema.<locals>.<genexpr>c                 s   r   )r   r   Nr   r    r   r   r#   r$   _   r%   F)assume_valid)

isinstancedictget	TypeErrorr   anyappendr   r   build_client_schema_orig)r   schema_introspectionr   r   r   r#   r   ?   s"   


N)graphqlr   r   r   r-   graphql.pyutilsr   )graphql.utilities.get_introspection_queryr   r   __all__FIELDFRAGMENT_SPREADINLINE_FRAGMENTr   __annotations__r   r   r   r   r#   <module>   sL    

