生成刺激性的打字稿类型

发布于 2025-02-01 20:43:45 字数 563 浏览 3 评论 0原文

虽然切片机类型得到更好的支持,但会有所帮助的是,如果Prismic将提供标准的Swagger/Open API或GraphQl模式我的存储库的类型进入项目,并为每个切片手动使用。

我知道您提供API浏览器 - > https://my-org.prismic.io/api/api/v2 )和a graphiql-> https://my-org.prismic.io/graphql ,但无法真正得到它们使用以前的代码生成器,因为我无法从API浏览器中获得标准的Swagger.json或GraphQl架构。

获取这些标准接口将使我能够再次运行发电机,以在我对PRISMIC中的自定义类型进行更改的任何时候更新生成的TS。

我尝试关注此链接自定义类型API,但它不起作用。

While slices machine types are better supported, something that will help us is if Prismic would provide a standard Swagger/Open API or Graphql Schema so I can run swagger-typescript-api or Generate code from your GraphQL schema to get the types from the custom types of my repository into the project and manually use for each slice.

I know you provide API browser -> https://my-org.prismic.io/api/v2) and a GraphiQL -> https://my-org.prismic.io/graphql but can't really get them working with the previous code generators as I can't get the standard swagger.json or Graphql schema from your API Browser.

Getting those standard interfaces would allow me to run the generators again to get the generated ts updated anytime I made changes to the custom types in Prismic.

I tried following this link Custom Types API but it's not working.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文