GraphQL Overview
Contract Eagle uses the Hot Chocolate GraphQL implementation, supporting a browser-based UI for interrogating the schema, crafting and testing queries and mutations.
The same User Authentication and IP Address Restrictions applied to the REST API are also applied to the GraphQL endpoint
- Document binary data is only available via the REST API
Connecting to the GraphQL API Endpoint
Access to the GraphQL endpoint is via your organisation's instance of Contract Eagle Connect.
The Connect URL will be of the form:
- https://[myorganisation]-connect.contracteagle.com
where [myorganisation] is the prefix to your Contract Eagle application.
eg: If you access the Contract Eagle application from https://acme.contracteagle.com, Contract Eagle Connect would be accessed from https://acme-connect.contracteagle.com
To access the GraphQL endpoint, append the /graphql/ui path to the Connect URL
eg: https://acme-connect.contracteagle.com/graphql/ui
Browser UI
Before you start
To connect via the browser you will need to create a JSON string with the Client Key and Secret of a user with API access.
{"ClientKey":"9cUN...=","ClientSecret":"1Nc...=="}
It is also possible to authenticate using a JWT Token, however you would need to request the token via another means, such as Postman, and the token expires making this method impractical for this scenario.
JWT Token authentication can be used when accessing the GraphQL endpoint via an application.
Refer to the Authentication section for further details
The browser-based UI is accessed by browsing to the GraphQL endpoint from either Chrome or Edge.
After a short initial loading time, the Banana Cake Pop (Hot Chocolate UI) will be displayed:
Click on the highlighted Settings icon and in the dialog, select the Headers option
Create a key of "Eagle-Api-Key" and paste in the client authentication JSON created above and then click Apply
Run your first query
To run this query, the API user will require at least Contract Manager Administration > Contract Status Type - View access configured for the appropriate business unit (normally "Default").
In the Operations panel paste the following query
query getStatusTypes ($statusTypeFilter: StatusTypeFilterInput) {
statusTypes (inputFilter: $statusTypeFilter) {
statusTypeId
statusTypeDescription
statusTypeBusinessUnit {
businessUnitId
businessUnitDescription
}
}
}
In the Variables panel, paste the following - you may need to change the "open" value of the description filter to a valid Status Type for your Contract Eagle implementation.
{
"statusTypeFilter" : { "descriptionFilter": "open"}
}
Click the run button - if successful, the results panel should display any status types matching the filter used.
Explore the Schema
The full available schema is available by selecting the Schema Reference option above the Operations panel.
You can navigate to view details of the available queries, mutations (create and update requests) and the associated objects - query results, query input filters and mutation inputs.