prismicio / prismic-ts-codegen

A Prismic model-to-TypeScript-type generator.
Apache License 2.0
18 stars 6 forks source link

Type 'Client' is not generic #21

Closed quintenb closed 2 years ago

quintenb commented 2 years ago

I installed and ran the generator, but it gives this typescript error at the end of the file.

Screenshot 2022-06-30 at 15 52 41

any idea how to resolved this?

angeloashmore commented 2 years ago

Hi @quintenb, thanks for trying out the new tool! 🙂

You probably need to update your version of @prismicio/client. prismic-ts-codegen requires at least @prismicio/client v6.6 (v6.6.1 is the latest as of this message).

You can install the latest version with the following command:

npm i @prismicio/client@latest

If this doesn't fix the issue, let me know and I will re-open it. Thanks!

quintenb commented 2 years ago

Thanks, this works!

Before I tried this tool I had implemented the type generation based on graphql codegen. But this tool is much more elegant. Thanks a lot!