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

getAll*() methods are not typed with a limit param #233

Closed
angeloashmore opened this issue Apr 13, 2022 · 0 comments · Fixed by #234
Closed

getAll*() methods are not typed with a limit param #233

angeloashmore opened this issue Apr 13, 2022 · 0 comments · Fixed by #234
Labels
bug Something isn't working

Comments

@angeloashmore
Copy link
Member

angeloashmore commented Apr 13, 2022

Versions

  • @prismicio/client: 6.4.2
  • node: v16.14.2

Reproduction

import * as prismic from "@prismicio/client";

const client = prismic.createClient("qwerty");
await client.getAllByType("page", { limit: 3 });

Steps to reproduce

Add the above code to a TypeScript-enabled project. The limit param will throw a type error since the limit param does not exist in the param's type.

Change getAllByType() to any getAll*() method (except dangerouslyGetAll(), which has the correct behavior) to see the error in other methods.

What is expected?

limit is accepted as a param.

What is actually happening?

TypeScript throws a type error. The code works correctly at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant