Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrectly documented QueryResponse type in typescript.mdx #381

Merged
merged 1 commit into from
May 8, 2024

Conversation

ashishpandey001
Copy link
Contributor

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.

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;
};
```
this kinda confused me and hence this docs correction.
Copy link

netlify bot commented May 8, 2024

Deploy Preview for electrodb-dev ready!

Name Link
🔨 Latest commit fa3e9e5
🔍 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.

@tywalch tywalch merged commit e42fb34 into tywalch:master May 8, 2024
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants