Developer Docs
API Quick Start Tutorials

GraphQL Tutorial

apollo studio graphql setup the url for the xecta gql endpoint is https //api onxecta com/api/gql https //api onxecta com/api/gql navigate to apollo studio to navigate to apollo studio, open your web browser and navigate to https //api onxecta com/api/gql https //api onxecta com/api/gql generate bearer token and configure headers jwt token you can use a user based jwt from the prodx application or a bearer token from mtls for mtls, please refer to the postman tutorial docid\ lgtlviilhglckn 0qa8mg for instructions on obtaining a token to obtain a user based, navigate to prodx at \[customer] app onxecta com, click on your initials in the top right corner of the screen to open the menu, and click directly on your name to copy a token to the clipboard note jwt tokens expire after a period of time if queries stop functioning, generate a new token and update your query or shared header headers add a header with the key name "authorization" and the value as "bearer {insert jwt token here}" make sure you leave a space between bearer and the token itself adding a header as shown below will only apply to the current query if you click the link at the bottom right of the center column titled "set shared headers", you can set a global header which will apply to all query tabs you have open note jwt tokens expire after a period of time if queries stop functioning, generate a new token and update your query or shared header query wells for many of the graphql requests, you will need to run a query to get the xid's (xecta's unique identifiers for your data entries) for the wells which you want to interact with you can enter a query manually in the center "operation" section of apollo or you can use the navigation tree on the right side of the screen to interactively build a query hovering over items in the tree will launch a popup with additional documentation about the entity query getwellinfo { wells2 { xid uwi sourceid name } } paste this query into apollo studio and click the "getwellinfo" execution button this will return all wells in the database in the response section on the right query well performance analysis results one of the most common queries is for cleansed daily data supplemented with all daily output values from prodx (like bottomhole pressure, productivity index, etc ) the sample below shows you how to query for this information query wellperformanceanalysisresults($where wellperformanceanalysisresultfilterinput, $wellscriteria wellscriteria) { wells2(wellscriteria $wellscriteria) { xid name wellperformanceanalysisresults(where $where) { wellxid bottomholedepth bottomholedepthsource bottomholepressure bottomholedepthreservoir bottomholedepthsourcereservoir bottomholepressurereservoir bottomholepressurecorrelation reservoirpressure productivityindexoil productivityindexgas productivityindexliquid productivityindexwater cumulativeoilproduction cumulativewaterproduction cumulativegasproduction cumulativegasoilratio timeon gasoilratio watercut instantaneousrecoveryratiototal dynamicdrainagevolumetotal productionmethod elapsedtime productiondelta current drawdown epochtime opportunity opportunityfield recommendation recommendationfield liquidrate boerate cumulativeboeproduction cumulativeliquidproduction timeonoil timeongas timeonliquid downtimecorrectedoilrate downtimecorrectedwaterrate downtimecorrectedgasrate downtimecorrectedgasliftinjectionrate downtimecorrectedwaterinjectionrate downtimecorrectedgasinjectionrate espheaddegradationpercent ratenormalizeddeltapressurechoke pressurenormalizedrateliquid pressurenormalizedrateoil pressurenormalizedrategas gasliquidratio insiturategaugenode criticalgasratesurface criticalgasrategaugenode criticalgasrateturnergaugenode criticalgasratecolemangaugenode criticalgasratenagoogaugenode totalgasrate esphead espgasseparationefficiency xid date oilrate gasrate waterrate tubingpressure choke gaugepressure wellheadtemperature gaugetemperature casingpressure linepressure gasliftinjectionrate espfrequency espintakepressure espamps espvolts espdischargepressure espmotortemperature espvibration srpstrokespermin srpintakepressure srpfluidload srpfillage downtimehours downtimecode waterinjectionrate gasinjectionrate isannularflow } } } paste the query above into the "operation" panel of apollo studio for this query, you will have to add "variables" for the start date, end date, and a list of xids (xecta unique identifier for the well) that you want to query at the bottom of the apollo studio, click the "variables" tab, and paste in the following code make sure the startdate and enddate are iso8601 complaint date strings variables { "where" { "date" { "gte" "2000 01 01t06 00 00 000z", "lte" "2024 01 01t06 00 00 000z" } }, "wellscriteria" { "xids" \["96cbd395 a590 4573 b819 793e6a1bddc7"] } } press the blue "wellperformanceanalysisresults" execution button in the top right of the "operation" section of apollo studio you will see your results for your listed wells on the right you can change from a json to tabular view by switching between the icons below