Type alias ToManyRelationship<T>

ToManyRelationship<T>: {
    data: ResourceIdentifier<T>[] | null;
    links?: {
        self?: string;
    };
    meta?: {
        pg: NextPageParams;
    };
}

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

type User = {
id: string;
type: "users";
name: string;
email: string;
friends: {
data: null | Array<{
id: string;
type: "users";
}>;
meta: {
pg: NextPageParams;
}
}
}

If data is null, this indicates that the relationship has not yet been "inflated".

Type Parameters

  • T extends string

Type declaration

  • data: ResourceIdentifier<T>[] | null

    The resource identifiers pointing to the related resources

  • 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

  • Optional meta?: {
        pg: NextPageParams;
    }

    Additional information about the resources

Generated using TypeDoc