ModelPrimaryCompositeKeyInput<SkIr>: {
    beginsWith?: SkIr;
    between?: [SkIr];
    eq?: SkIr;
    ge?: SkIr;
    gt?: SkIr;
    le?: SkIr;
    lt?: SkIr;
}

A composite SK (in an identifier or secondaryIndex) resolves to this type for list queries and index queries

Type Parameters

  • SkIr extends Record<string, string | number>

Type declaration

  • Optional beginsWith?: SkIr
  • Optional between?: [SkIr]
  • Optional eq?: SkIr
  • Optional ge?: SkIr
  • Optional gt?: SkIr
  • Optional le?: SkIr
  • Optional lt?: SkIr

Example

Given

MyModel: a
.model({
pk: a.string().required(),
sk1: a.string().required(),
sk2: a.integer().required(),
})
.identifier(['pk', 'sk1', 'sk2']),

Expected list options:

{
pk?: string
sk1Sk2?: ModelPrimaryCompositeKeyConditionInput
}

Where ModelPrimaryCompositeKeyConditionInput resolves to:

{
eq: {sk1: string; sk2: number};
le: {sk1: string; sk2: number};
lt: {sk1: string; sk2: number};
ge: {sk1: string; sk2: number};
gt: {sk1: string; sk2: number};
between: [ {sk1: string; sk2: number} ];
beginsWith: {sk1: string; sk2: number};
}

reference: https://github.com/aws-amplify/amplify-category-api/blob/a655e71115e0e8e3597b4c2ef1b2940a79fdcaa1/packages/graphql-transformer-common/src/dynamodbUtils.ts#L32-L36