1.10.1 • Published 8 years ago

gql2ts v1.10.1

Weekly downloads
9,175
License
MIT
Repository
github
Last release
8 years ago

GQL2TS

npm install -g gql2ts
Usage: index [options] <schema.json | schema.gql> <query.gql>

Options:

  -h, --help                         output usage information
  -V, --version                      output the version number
  -o --output-file [outputFile]      name for output file, will use stdout if not specified
  -n --namespace [namespace]         name for the namespace, defaults to "GQL"
  -i --ignored-types <ignoredTypes>  names of types to ignore (comma delimited)
  -l --legacy                        Use TypeScript 1.x annotation
  -e --external-options              ES Module with method overwrites

Usage Explanation

Schema can be inputted via a file or stdin and formatted as either JSON (Introspection Query result) or GraphQL Schema Language.

If a query.gql file is specified, gql2ts will run the query against the schema and generate interfaces based on that. If no query is specified, gql2ts will create a namespace for your schema and add the interfaces to there.

For -e or --external-options, the input should be either an ES Module with a default export or a CommonJS Module that defines a language package (default: @gql2ts/language-typescript) or overrides for a language. The interface for this file (export default Partial<IFromQueryOption>) can be found in @gql2ts/types.

Examples

With Default Options

# outputs to stdout
gql2ts schema.json
# outputs to file graphql.d.ts
gql2ts schema.json -o graphql.d.ts

With Optional Options

gql2ts -n Avant -i BadInterface,BadType,BadUnion -o avant-gql.d.ts schema.json

With stdin

cat schema.json | gql2ts
2.0.0-3

8 years ago

2.0.0-2

8 years ago

2.0.0-1

8 years ago

2.0.0-0

8 years ago

1.10.1

8 years ago

1.10.0

8 years ago

1.9.0

8 years ago

1.8.2

8 years ago

1.8.2-0

8 years ago

1.8.1

8 years ago

1.8.0

8 years ago

1.7.2

8 years ago

1.7.2-4

8 years ago

1.7.2-y.0

8 years ago

1.7.2-1

8 years ago

1.7.2-0

8 years ago

1.7.1

8 years ago

1.7.0

8 years ago

1.6.0

8 years ago

1.6.0-2

8 years ago

1.6.0-1

8 years ago

1.6.0-0

8 years ago

1.5.2

8 years ago

1.5.1

8 years ago

1.5.0

8 years ago

1.4.4

8 years ago

1.4.3

8 years ago

1.4.2

8 years ago

1.4.1

8 years ago

1.4.0

9 years ago

1.3.0

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

1.0.0-alpha.7

9 years ago

1.0.0-alpha.6

9 years ago

1.0.0-alpha.5

9 years ago

1.0.0-alpha.4

9 years ago

1.0.0-alpha.3

9 years ago

1.0.0-alpha.2

9 years ago

0.6.1

9 years ago

0.6.0

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.0

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago