@tsukinoko-kun/gqlc
v1.1.2
Published
GraphQL compiler
Readme
Gqlc
GraphQL compiler and type generator.
Installation
npm i --global @tsukinoko-kun/gqlcbrew install tsukinoko-kun/tap/gqlcscoop bucket add tsukinoko-kun https://github.com/tsukinoko-kun/scoop-bucket
scoop install gqlcSetup
gqlc initThis will create a gqlc.yaml file in the current directory.
Example configuration:
input:
schemas: https://graphql.anilist.co
operations: src/graphql/operations
output:
location: src/graphql
language: typescript
suffix: _gqlc
import_include_extension: falseWrite your GraphQL queries in the directory specified by input.operations.
Example query:
query ExampleQuery($search: String) {
Media(search: $search) {
bannerImage
averageScore
coverImage {
medium
color
}
seasonYear
seasonInt
title {
english
native
romaji
}
}
}Usage
Run the compiler:
gqlcThe compiler will generate TypeScript files in the directory specified by output.location.
You can import this generated files in your TypeScript code.
Depending on your build system, you might include the generated files in your version control or not.
License
Zlib
