How can I parse one line type definition ? #8344
-
Hi, I am working on an extension to the typescript-operations plugin. I have what I want but the resulted types are all in one line.
Is there an already implemented function anywhere that returns the formated string ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @poljsakerik, GraphQL Code Generator does not use any external tool to format the generated TypeScript code. Please note that we handle indenting and line breaks manually, as showcases here: |
Beta Was this translation helpful? Give feedback.
Hi @poljsakerik,
GraphQL Code Generator does not use any external tool to format the generated TypeScript code.
However, we created a set of utils to make the code generation easier, like
DeclarationBlock
, that you can see used here:graphql-code-generator/packages/plugins/other/visitor-plugin-common/src/base-types-visitor.ts
Line 407 in aa0b906
Please note that we handle indenting and line breaks manually, as showcases here:
graphql-code-generator/packages/plugins/other/visitor-plugin-common/src/base-types-visitor.ts
Line 423 in aa0b906