tywalch / electrodb

A DynamoDB library to ease the use of modeling complex hierarchical relationships and implementing a Single Table Design while keeping your query code readable.
MIT License
1.03k stars 66 forks source link

Fix incorrectly documented QueryResponse type in typescript.mdx #381

Closed ashishpandey001 closed 6 months ago

ashishpandey001 commented 6 months ago

As per the index.d.ts file and in general how query responses are shaped the QueryResponse type is correctly typed as:

export type QueryResponse<E extends Entity<any, any, any, any>> = {
  data: EntityItem<E>[];
  cursor: string | null;
};

though in the docs reference it was typed as:

export type QueryResponse<E extends Entity<any, any, any, any>> = {
  data: EntityItem<E>;
  cursor: string | null;
};

Notice the data: EntityItem<E>[] in the declaration file vs data: EntityItem<E> in the docs. This kinda confused me and hence this docs correction.

netlify[bot] commented 6 months ago

Deploy Preview for electrodb-dev ready!

Name Link
Latest commit fa3e9e5e1a475d59ef84f4c41e797035b61d3dd5
Latest deploy log https://app.netlify.com/sites/electrodb-dev/deploys/663b3bb00c784e0008a8706f
Deploy Preview https://deploy-preview-381--electrodb-dev.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.