OwlCyberSecurity - MANAGER
Edit File: graphene.cpython-312.pyc
� G��g� � � � d dl mZ d dlZd dlmZ d dlmZmZmZ d dl m Z d dlmZm Z mZmZ d dlmZ d d lmZ er(d d lmZ d dlmZmZmZ d dlmZ d d lmZ d dlm Z d dl!m"Z" G d� de� Z#d� Z$d� Z%ed� � Z&y# e$ r ed� �w xY w)� )�contextmanagerN)�OP)�_check_minimum_version�DidNotEnable�Integration)�should_send_default_pii)�capture_internal_exceptions�ensure_integration_enabled�event_from_exception�package_version)�schemazgraphene is not installed)� TYPE_CHECKING)� Generator)�Any�Dict�Union)�Source)�ExecutionResult)� GraphQLSchema)�Eventc � � e Zd ZdZed� � Zy)�GrapheneIntegration�graphenec �N � t d� } t t | � t � y )Nr )r r r �_patch_graphql)�versions �O/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/graphene.py� setup_oncezGrapheneIntegration.setup_once! s � � "�*�-���2�G�<��� N)�__name__� __module__�__qualname__� identifier�staticmethodr � r r r r s � ��J��� �r r c � ��� t j �t j �t t �� �fd�� } �fd�}| t _ |t _ y )Nc �� �� t j � }|j t � t | ||� 5 � | |g|��i |��}d d d � t � 5 t j � }j xs g D ]E }t ||j t j dd��� \ }} t j || �� �G d d d � |S # 1 sw Y ��xY w# 1 sw Y S xY w�NF)�type�handled)�client_options� mechanism)�hint) � sentry_sdk�get_isolation_scope�add_event_processor�_event_processor�graphql_spanr � get_client�errorsr �optionsr r# � capture_event)r �source�args�kwargs�scope�result�client�error�eventr- �old_graphql_syncs �r �_sentry_patched_graphql_syncz4_patch_graphql.<locals>._sentry_patched_graphql_sync/ s� �� � �.�.�0�� �!�!�"2�3� �&�&�&� 1�%�f�f�F�t�F�v�F�F� 2� )� *��*�*�,�F����,�"�,��2��#)�>�>� 3� >� >�#(�����t� �(�(��T�:� -� +� � �! 2� 1�� +� � �s �C�A-C�C�C&c � �n �K � t j � j t � }|� �| |g|��i |��� d { ��� S t j � }|j t � t | ||� 5 �| |g|��i |��� d { ��� }d d d � t � 5 t j � }j xs g D ]E }t ||j t j dd��� \ } } t j | | �� �G d d d � |S 7 ��7 ��# 1 sw Y ��xY w# 1 sw Y S xY w�wr( )r. r3 �get_integrationr r/ r0 r1 r2 r r4 r r5 r# r6 )r r7 r8 r9 �integrationr: r; r<