Skip to main content

Getting Started

Consumers of data from the LIV Data Platform access data through a GraphQL API, providing query access and subscriptions to various models.

The LIV Data Platform GraphQL API allows consumers of the API to query data, and subscribe to real-time data changes using a common schema and query language. Unlike a traditional REST API, GraphQL allows consumers to retrieve only the data that they need and in a format that they want and providing a common way to subscribe to real-time updates.

GraphQL Core Concepts

Schema

A GraphQL schema is a description of the types of data that can be queried using a GraphQL API. It defines the fields and relationships between those fields, as well as any arguments that can be passed to them. The schema serves as the contract between the client and server, ensuring that the client knows exactly what data can be requested and in what format. It also allows for clear and concise documentation of the API, making it easier for developers to understand and use. In GraphQL, the schema is written in a special syntax that defines the types, fields, and relationships using a hierarchical structure.

Query

Queries are requests for data that are made to a GraphQL API by a consumer of the API. A query consists of a set of fields that the consumer wants to retrieve, along with any arguments that are required to specify the exact data that is needed. The client specifies the fields and arguments in a hierarchical structure that reflects the structure of the data presenting in the Schema. This allows the client to retrieve only the data that is needed and in the format that is required. GraphQL queries are strongly typed, meaning that the types of the fields and arguments are defined in the schema. This makes it easy for the client to know exactly what data can be requested and what format it will be returned in.

Mutations

GraphQL mutations are requests that are used to modify data in a GraphQL API. Mutations are written in a hierarchical structure, with the fields and arguments specifying the exact data that should be modified. Mutations typically correspond to actions that change the state of the system, such as creating, updating, or deleting resources. When a mutation is executed, the server will perform the specified action and return a result that indicates the success or failure of the operation. GraphQL mutations can be composed into a single request, allowing the client to perform multiple operations in a single round-trip, reducing the number of requests required to make changes to the system, which can improve performance and reduce network overhead.

Subscriptions

GraphQL subscriptions are a way to receive real-time updates from a GraphQL API when the data changes. Subscriptions, similarly to queries, specify a set of fields that the consumer of the API is interested in receiving, but rather than returning the data once, they create a long-lived connection between the client and the server. When the data changes on the server, the server sends a message to the client over the open connection, allowing the client to update in real-time. Subscriptions are useful for scenarios such as live updates. Subscriptions use the same schema as queries and mutations, making it easy to add real-time functionality for consumers.

Notifications

The LIV Data Platform also provides a stateless notification service. This allows clients to build event driven solutions without needing to manage multiple stateful connections. These notifications contain the same data updates provided via GraphQL subscriptions.

See for details on how to connect