
    gh                     *   S SK Jr  S SKrS SKJr  S SKJrJrJr  S SK	J
r
  S SKJrJrJrJr   S SKJr  S S	KJr  \(       a(  S S
KJr  S SKJrJrJr  S SKJr  S SKJr  S SKJ r   S SK!J"r"   " S S\5      r#S r$S r%\S 5       r&g! \ a	    \" S5      ef = f)    )contextmanagerN)OP)_check_minimum_versionDidNotEnableIntegration)should_send_default_pii)capture_internal_exceptionsensure_integration_enabledevent_from_exceptionpackage_version)schemazgraphene is not installed)TYPE_CHECKING)	Generator)AnyDictUnion)Source)ExecutionResult)GraphQLSchema)Eventc                   (    \ rS rSrSr\S 5       rSrg)GrapheneIntegration   graphenec                  N    [        S5      n [        [        U 5        [        5         g )Nr   )r   r   r   _patch_graphql)versions    c/home/kali/devsecops-assessor/venv/lib/python3.13/site-packages/sentry_sdk/integrations/graphene.py
setup_onceGrapheneIntegration.setup_once!   s     "*-2G<     N)__name__
__module____qualname____firstlineno__
identifierstaticmethodr   __static_attributes__r"   r!   r   r   r      s    J r!   r   c                     ^^ [         R                  m[         R                  m[        [        T5      U4S j5       n U4S jnU [         l        U[         l        g )Nc           	        > [         R                  " 5       nUR                  [        5        [	        XU5         T
" X/UQ70 UD6nS S S 5        [        5          [         R                  " 5       nWR                  =(       d    /  H?  n[        UUR                  [        R                  SS.S9u  p[         R                  " XS9  MA     S S S 5        U$ ! , (       d  f       N= f! , (       d  f       W$ = f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eventr1   old_graphql_syncs             r   _sentry_patched_graphql_sync4_patch_graphql.<locals>._sentry_patched_graphql_sync/   s     ..0!!"23&&1%fFtFvFF 2 )***,F,",2#)>> 3 > >#( ((: - + ! 21 +* s   CA.C 
C 
C/c           	        >#    [         R                  " 5       R                  [        5      nUc  T" X/UQ70 UD6I S h  vN $ [         R                  " 5       nUR                  [        5        [        XU5         T" X/UQ70 UD6I S h  vN nS S S 5        [        5          [         R                  " 5       nWR                  =(       d    /  H?  n[        UUR                  [        R                  SS.S9u  p[         R                  " XS9  MA     S S S 5        U$  N N! , (       d  f       N= f! , (       d  f       W$ = f7fr,   )r2   r7   get_integrationr   r3   r4   r5   r6   r	   r8   r   r9   r'   r:   )r   r;   r<   r=   integrationr>   r?   r@   rA   rB   r1   old_graphql_asyncs              r   _sentry_patched_graphql_async5_patch_graphql.<locals>._sentry_patched_graphql_asyncG   s     ++-==>QR*6KDKFKKK..0!!"23&&1,VMdMfMMF 2 )***,F,",2#)>> 3 > >#( ((: - + + L N 21 +* sR   ;D?D:D?9D	D
DD? A.D-D?D
D*&D?-
D<7D?)graphene_schemagraphql_syncgraphqlr
   r   )rD   rJ   rI   rC   s     @@r   r   r   *   sO    &33'// 35EF G.6 $@O ;Or!   c                     [        5       (       a  U R                  S0 5      nSUS'   U $ U R                  S0 5      R                  S5      (       a  U S   S	 U $ )NrequestrN   
api_targetdata)r   
setdefaultget)rB   r1   request_infos      r   r5   r5   f   s^      ''	26%.\"
 L 
9b	!	%	%f	-	-)V$Lr!   c              #     #    UR                  S5      nSn[        R                  nUR                  5       R	                  S5      (       a  Sn[        R
                  nO6UR                  5       R	                  S5      (       a  Sn[        R                  n[        R                  " UUS.SS.S9  [        R                  " 5       nUR                  (       a  UR                  R                  XSS	9nO[        R                  " XSS	9nUR                  S
U5        UR                  SU5        UR                  SU5         S v   UR                  5         g ! UR                  5         f = f7f)Noperation_namequerymutationsubscription)rW   operation_typezgraphql.operation)rR   category)crumb)opnamezgraphql.documentzgraphql.operation.namezgraphql.operation.type)rT   r   GRAPHQL_QUERYstrip
startswithGRAPHQL_MUTATIONGRAPHQL_SUBSCRIPTIONr2   add_breadcrumbget_current_scopespanstart_child
start_spanset_datafinish)r   r;   r=   rW   r[   r^   r>   _graphql_spans           r   r6   r6   r   s*     ZZ 01NN			B||~  ,,#  		"	">	2	2'$$ #1"0 ,
 ((*Ezz

..".J"--I-v63^D3^Ds   D5E"8E <E"EE")'
contextlibr   r2   sentry_sdk.constsr   sentry_sdk.integrationsr   r   r   sentry_sdk.scoper   sentry_sdk.utilsr	   r
   r   r   graphene.typesr   rL   ImportErrortypingr   collections.abcr   r   r   r   graphene.language.sourcer   graphql.executionr   graphql.typer   sentry_sdk._typesr   r   r   r5   r6   r"   r!   r   <module>rz      s    %    U U 4 48 !)''/1*'	+ 	9<x	 $ $G  4
2
334s   B B