Type alias ToOneRelationship<T, Nullable>

ToOneRelationship<T, Nullable>: {
    data: Nullable extends "nullable"
        ? ResourceIdentifier<T> | null
        : ResourceIdentifier<T>;
    links?: {
        self?: string;
    };
}

Describes a to-one relationship in an API response object. For example:

type User = {
id: string;
type: "users";
name: string;
email: string;
bestFriend: {
data: {
id: string;
type: "users";
}
}
}

Type Parameters

  • T extends string

  • Nullable extends "nullable" | "non-nullable" = "non-nullable"

Type declaration

  • data: Nullable extends "nullable"
        ? ResourceIdentifier<T> | null
        : ResourceIdentifier<T>

    A resource identifier pointing to the related resource

  • Optional links?: {
        self?: string;
    }

    An optional collection of links describing additional actions you can take on this resource

    • Optional self?: string

      The address by which you can obtain this resource's full data

Generated using TypeDoc