GraphQL API Quickstart
This guide will help you become acquainted with Deal Engine's GraphQL API as easily as possible.
Some basic knowledge of HTTP APIs usage is required, more specifically on how to build queries in GraphQL language.
GraphQL Clients
In order to start exchanging data with the DealEngine's GraphQL API, you will need a GraphQL client.
For quick exploration, we provide an online client: GraphiQL Playground.
However, we also provide some example queries and mutations you can try right on this page
There are a lot of other ways of sending GraphQL queries, some popular GUI clients are Altair GraphQL Client or Postman. Also, be sure to check out Awesome GraphQL when looking for a GraphQL client library for your favorite programming language.
Connecting to DealEngine's GraphQL endpoint
Our GraphQL endpoint is located at the following URL:
https://deal-engine.com/graphql
Most clients, once given the endpoint URL will send an introspection query to the remote API and retrieve all available operations and types of data that you can exchange with the server. This provides you with code autocompletion and inline documentation.
GraphQL Schema Operations and Data Types
The pages linked at the left side of this page list all the
possible operations like Queries
and Mutations
that you can
currently use. You can also see a list of Objects
, Scalars
,
Inputs
, and other data types that you will receive and exchange
when using DealEngine's API.
Feel free to explore the left navbar, a good starting point is
looking at the schema/queries
and schema/mutations
.
For example, the playground in the next section uses the AuthQueries object to retrieve information about the currently logged-in user. And AuthMutations in order to obtain a new session token and authenticate as a user.
Also, this site has a Search box at the top of this page that you can use to find information about a specific type, or about any other context.
DealEngine's GraphQL API is always evolving and getting better. This documentation is automatically updated whenever we publish some changes. Thus you can be assured that this page will always reflect the current operations and data types available.
Either
types: convention for signaling errors.
You will notice that some objects inside the API Graph are wrapped inside Either
types.
These types are useful for signaling that the API was not able to determine a correct value
(success values are always available at the Either.right
field).
In those cases, an error message or an alternative object is available to you
at the Either.left
field.
For example, the EitherErrorMessageOrFareConstruction object
is defined like below. If for some reason we are unable to obtain the FareConstruction value you'll get
an error message on the left: ErrorMessage
field, otherwise a right: FareConstruction
on success.
type EitherErrorMessageOrFareConstruction {
left: ErrorMessage
right: FareConstruction
}
Users familiar with functional programming languages like Scala will feel right at home with these Either*
types.