0iVddlZddlmZmZmZddlmZmZmZddl m Z  ddl Z ddl m Z mZmZmZddlmZmZddlmZ ddl mZdd lmZer%dd lmZmZmZmZdd lmZm Z ee!ee!eed fffZ"GddeZ#dZ$dZ%dZ&dZ'dZ(y#e$rdZYQwxYw#e$r ed wxYw)N)event_from_exceptionensure_integration_enabled parse_version)_check_minimum_version DidNotEnable Integration)should_send_default_pii) print_astget_operation_ast DocumentNodeVariableDefinitionNode) TransportAsyncTransport)TransportQueryError)GraphQLRequestzgql is not installed) TYPE_CHECKING)AnyDictTupleUnion)EventEventProcessor.c eZdZdZedZy)GQLIntegrationgqlcjttj}tt|t y)N)rr __version__rr_patch_execute) gql_versions J/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/gql.py setup_oncezGQLIntegration.setup_once+s"$COO4 ~{;N)__name__ __module__ __qualname__ identifier staticmethodr!r"r rr(sJr"rc t|}dt|i}|4|j|d<|j|jj|d<|S#t t f$r tcYSwxYw)Nquery variables operationName)r r variable_definitionsnamevalueAttributeError TypeErrordict)document operation_astdatas r _data_from_documentr64sx )(3 8,-  $ - B BD !!-(5(:(:(@(@_% I &v sAAA.-A.c: |jS#t$rYywxYw)zg The RequestsHTTPTransport allows defining the HTTP method; all other transports use POST. POST)methodr0) transports r _transport_methodr;Ds%  s  ch|iSdt|i} |j|d<|S#t$rY|SwxYw)Nr9url)r;r=r0)r: request_infos r _request_info_from_transportr?PsV  #I.L 'mm U     s $ 11ctjjttfd}|tj_y)Nc0tj}|jt|| ||g|i|S#t$rM}t |tj jddd\}}tj|||d}~wwxYw)NrF)typehandled)client_options mechanism) sentry_sdkget_isolation_scopeadd_event_processor_make_gql_event_processorrr get_clientoptions capture_event) selfdocument_or_requestargskwargsscopeeeventhint real_executes r sentry_patched_executez._patch_execute..sentry_patched_executees..0 !!";DBU"VW &9KDKFK K" .)446>>#(U;KE4  $ $UD 1G s ? BABB)rClientexecuterr)rVrUs @r rras9::%%L =>"0CJJr"cfd}|S)Nc |ddj}|jdi}|j ddit j trmtttr j}n}t||d<|jdi}|jdi}|j d |i|d |S#ttf$rd}YwxYw) Nexc_inforequest api_targetgraphqlr5contextsresponseerrors)r5rB) rbr0KeyError setdefaultupdater?r:r r isinstancer3r6) rSrTrbr]r3r`raclientrNs r processorz,_make_gql_event_processor..processor|s *%a(//F""9b1i .v/?/?@   # $)j#^/ /77.1(;GFO'' B7H**:r:H OO%v.$  A) F sCCCr()rgrNrhs`` r rIrIzs$L r"))rFsentry_sdk.utilsrrrsentry_sdk.integrationsrrrsentry_sdk.scoper rr_r r r r gql.transportrrgql.transport.exceptionsrr ImportErrortypingrrrrrsentry_sdk._typesrrstr EventDataTyperr6r;r?rrIr(r"r rss VU4/ 8<&!..7eC/Es/J)K$KLLMM [   "02(C / - ../s(BB BBBBB(