@nanolier/typescript-graphql-schema-type-generator
v0.0.6
Published
## ๐ CLI tool to create Type Alias for TypeScript from GraphQL schema
Downloads
616
Readme
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"
}
}