o
    tBh                     @   sP   d dl mZmZ d dlmZmZ dededefddZdedee fd	d
ZdS )    )IterableList)GraphQLScalarTypeGraphQLSchemaschemanamescalarc                 C   s   t |ts	td| |}|du rtd| dt |ts+td| dt| t|d|j t|d|j t|d	|j	 dS )
af  Update the scalar in a schema with the scalar provided.

    :param schema: the GraphQL schema
    :param name: the name of the custom scalar type in the schema
    :param scalar: a provided scalar type

    This can be used to update the default Custom Scalar implementation
    when the schema has been provided from a text file or from introspection.
    1Scalars should be instances of GraphQLScalarType.NzScalar 'z' not found in schema.z
The type "z&" is not a GraphQLScalarType, it is a 	serializeparse_valueparse_literal)

isinstancer   	TypeErrorget_typeKeyErrortypesetattrr
   r   r   )r   r   r   schema_scalar r   z/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/gql/utilities/update_schema_scalars.pyupdate_schema_scalar   s   


r   scalarsc                 C   s@   t |ts	td|D ]}t |tstdt| |j| qdS )a  Update the scalars in a schema with the scalars provided.

    :param schema: the GraphQL schema
    :param scalars: a list of provided scalar types

    This can be used to update the default Custom Scalar implementation
    when the schema has been provided from a text file or from introspection.

    If the name of the provided scalar is different than the name of
    the custom scalar, then you should use the
    :func:`update_schema_scalar <gql.utilities.update_schema_scalar>` method instead.
    z-Scalars argument should be a list of scalars.r	   N)r   r   r   r   r   r   )r   r   r   r   r   r   update_schema_scalars'   s   

r   N)	typingr   r   graphqlr   r   strr   r   r   r   r   r   <module>   s    !