o
    tBh                     @   sZ   d dl mZ ddlmZ ddlmZ ddlmZmZ ddl	m
Z
 dgZG d	d de
Zd
S )    )Any   )GraphQLError)	FieldNode)get_named_typeis_leaf_type   )ValidationRuleScalarLeafsRulec                   @   s&   e Zd ZdZdededdfddZdS )r
   zScalar leafs

    A GraphQL document is valid only if all leaf fields (fields without sub selections)
    are of scalar or enum types.
    node_argsreturnNc              
   G   s   | j  }|rC|j}tt|r)|r'|jj}| td| d| d| d S d S |sE|jj}| td| d| d| d| d S d S d S )NzField 'z(' must not have a selection since type 'z' has no subfields.z' of type 'z4' must have a selection of subfields. Did you mean 'z
 { ... }'?)	contextget_typeselection_setr   r   namevaluereport_errorr   )selfr   r   type_r   
field_name r   |/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/graphql/validation/rules/scalar_leafs.pyenter_field   s6   
	zScalarLeafsRule.enter_field)__name__
__module____qualname____doc__r   r   r   r   r   r   r   r
      s    N)typingr   errorr   languager   typer   r    r	   __all__r
   r   r   r   r   <module>   s    