简体   繁体   English

graphql codegen typescript-如何仅生成类型

[英]graphql codegen typescript - how to generate types only

I'm using the typescript plugin for graphql code generator 我正在为graphql代码生成器使用打字稿插件

According to the doc 根据文档

This is the most basic TypeScript plugin and it can generate typings based on GraphQLSchema, which can be used by any other typescript related plugin. 这是最基本的TypeScript插件,它可以基于GraphQLSchema生成类型,任何其他与Typescript相关的插件都可以使用它。

It generates types for your entire schema: types, input types, enums, interfaces, scalars and unions. 它为整个架构生成类型:类型,输入类型,枚举,接口,标量和联合。

Is it possible to generate only types? 是否可以仅生成类型? I couldn't find anything in the docs. 我在文档中找不到任何内容。

You could say that all of the items mentioned (types, input types, enums, interfaces, scalars and unions) are types. 您可以说所有提到的项目(types, input types, enums, interfaces, scalars and unions)都是类型。 If you need to generate only one of these items, unfortunately the typescript plugin currently does not support this. 如果您只需要生成其中一项,那么不幸的是,typescript插件当前不支持此功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何缩小 graphQL 代码生成自动生成的 Typescript 类型? - How to narrow Typescript Types autogenerated by graphQL codegen? aws amplify codegen:如何为 TypeScript 生成基本类型? - aws amplify codegen: how to generate base types for TypeScript? 如何使用Apollo Rover + Codegen生成typescript schema类型 - How to use Apollo Rover + Codegen to generate typescript schema types 当 Apollo Server 处于生产模式时,如何在 graphql-codegen 的帮助下为 React 生成 Graphql 类型? - How to generate Graphql types for React with help of graphql-codegen when Apollo Server is in production mode? 如何使用 Graphql Codegen 设置类型 - How to set up Types with Graphql Codegen Graphql打字稿打字和代码生成 - Graphql typescript typing and codegen graphql codegen 可以自动生成 hooks 的结果数据字段的类型吗? - Can graphql codegen automatically generate types for hooks' result data field? 如何使用 Graphql-codegen 在 Typescript 中实现 GraphQL 解析器? - How do I implement GraphQL resolvers in Typescript with Graphql-codegen? 如何在代码中使用Apollo Codegen Typescript类型? - How to use apollo codegen typescript types in code? 如何在没有操作的情况下使用 graphql schema.json 为 graphql 类型生成打字稿接口? - How to generate typescript interfaces for graphql types using a graphql schema.json without operations?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM