Schema SDK
The Schema SDK package provides a set of types for the HxDR platform GraphQL API schema (opens in a new tab). These types are used to define the shape of the data that is exchanged between the client and the server and are automatically generated from the platform's schema file.
This is moslty used internally by other SDK packages, but it can also be used directly in your application to define the shape of the data that you are working with.
It is best practise to not use the schmea types directly accross your application, but to create an abstraction layer that uses the types (like a data mapper). This layer can convert the types to your own domain types. This way, if a change to the platform schema occurs, you only need to update the abstraction layer instead of your whole application.
Installation
To install this package, you need to have access to the private @sdk
npm scope.
To integrate the SDK Schema package into your project, use the following command with your preferred package manager:
npm install @sdk/schema
Example
All types of the package are namespaced under the Schema
namespace.
import { Schema } from '@sdk/schema';
import { myUserProjectCapabilities } from './myUserProjectCapabilities';
const canModifyProject = myUserProjectCapabilities.includes(Schema.ProjectCapabilityEnum.CAN_MODIFY_PROJECT);