0.0.6 • Published 7 months ago
@nanolier/typescript-graphql-schema-type-generator v0.0.6
Typescript Graphql Schema Type Generator
🐈 CLI tool to create Type Alias for TypeScript from GraphQL schema
Getting Started
Install
Install the library.
npm i -D @nanolier/typescript-graphql-schema-type-generator
Add to scripts in package.json.
{
"scripts": {
"tgstgen": "tgstgen"
}
}
Create Type Alias File
npm run tgstgen
By default, "./schema.graphql" is read and "./src/__generated__/schema.graphql.ts". To change this, specify the file to be read and the output destination as arguments when executing the command.
npm run tgstgen .example-dir/schema.gql ./example-dir/__generated__/schema.graphql.ts
or
{
"scripts": {
"tgstgen": "tgstgen .example-dir/schema.gql ./example-dir/__generated__/schema.graphql.ts"
}
}