GraphQL Tutorial
Author(s): Kyle Vessey, December 2022
Developer Prerequisites:
- mTLS Certificate, Client ID and Client Secret Keys (tutorial)
- Visual Studio 2022 Community Edition
- Internet connection
Get the complete source code
Data Schema:
Please read the Data Schema Fundamentals document before using the API.
Visualizing Data:
Data inserted or modified using this tutorial can be visualized using the web portal application(s) at https://tenant.app.onxecta.com. The portal contains a Data Quality Reporting tool where you can see what data is in the system, the validity of the data and when the data was last modified.
To navigate to Apollo Studio, open your web browser and navigate to https://api.onxecta.com/api/gql

To generate a JWT Token, follow the steps in the Postman Tutorial regarding testing the credentials
Add a Header with the key name "Authorization" and the value as "Bearer {INSERT JWT TOKEN HERE}"

Bearer Token:
Make sure to leave a space between the word "Bearer" and the token you paste into this box
Apollo Studio is all set up!
For many of the GraphQL requests, you will need to run a query to get the XID's for the wells which you want to interact with.
XID
An XID is a Xecta UUID which is used to identify unique entries in the system
Paste this query into Apollo Studio and click the "GetWellInfo" execution button

This will return all of the data in the database in the response section on the right.
Well Performance:
To learn more about our Well Performance features, read the following documentation:
Field | Description |
xid | Unique row identifier for a particular well |
name | Well Name |
dates | Dates for particular record |
timeOn | Time on Production (excludes shut-in periods) |
prodIndex | Productivity Index |
cumOil | Cumulative Oil |
cumWater | Cumulative Water |
cumGas | Cumulative Gas |
bhp | |
ddv | |
irr | Instantaneous Recovery Ratio |
avgResPressure | Average Reservoir Pressure |
oilRate | Oil Rate |
gasRate | Gas Rate |
waterRate | Water Rate |
drawdown | Drawdown |
Paste the above query into Apollo Studio

For this query, you will have to add Variables as well for the startDate, endDate, and a list of XIDs that you want to fetch the Well Performance information for
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 dates as well.
XIDs
XIDs are unique identifiers for your particular wells. In order to grab these XIDs, follow the [tutorial above](https://docs.onxecta.com/docs/graphql-tutorial#get-well-information) and paste them as a comma separated list
Press the blue "WellPerformance" Execution button. You will see your results for your listed wells on the right

Helpful Tip: Change Response Views
You can change from a JSON to Tabular view by switching between the icons below

The following tutorials will allow you to call our GraphQL endpoints to pull Production Forecasts
Field | Description |
timeOn | Time on Production (excludes shut-in periods) |
date | Date of forecast |
oilRate | Oil Rate |
gasRate | Gas Rate |
waterRate | Water Rate |
cumulativeOil | Cumulative Oil |
cumulativeWater | Cumulative Water |
cumulativeGas | Cumulative Gas |
pwf | Bottomhole Pressure |
Paste the above query into Apollo Studio

For this query, add the following variables in the Variables tab at the bottom of the page. Be sure to include whichever start and end date range you are trying to view in ISO8610 format
Click the blue "ProductionForecast" execution button to view the results for the selected XIDs

The following tutorials will allow you to call our GraphQL endpoints to pull Anomalies
Field | Description |
uwi | Unique Well Identifier |
name | Name of the Anomaly |
anomalyType | Type of Anomaly |
description | Long description of the Anomaly |
actionable | Boolean - Is the Anomaly Actionable or Not |
severity | Severity of Anomaly (High / Medium / Low) |
timeObserved | Time in which the Anomaly was Observed |
For this query, add the following variables in the Variables tab at the bottom of the page. Be sure to include whichever start and end date range you are trying to view in ISO8610 format
Data Quality Report:
To learn more about our Data Quality Report, read the following documentation:
The following tutorials will allow you to call our GraphQL endpoints to demonstrate how we display data via our user interface.
To select multiple specific wells, you can enter multiple comma separated XID's