Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>gql2tsNew to Visual Studio Code? Get it now.
gql2ts

gql2ts

Preview

Bagubagu Studio

|
576 installs
| (0) | Free
Generate typescript interfaces automatically from gql template string
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

gql2ts VS Code Extension

Generate Typescript Interface definitions automatically from gql template strings. It uses apollo-codegen to create the Interface definition.

Features

Select gql2ts: create TS Interfaces from command palette.

screeshot

Requirements

Install apollo-codegen and get-graphql-schema globally

npm install apollo-codegen get-graphql-schema -g

This extension requires schema.json to be available. Use get-graphql-schema to retrieve schema.json from your server.

get-graphql-schema https://your.graphql.endpoint/graphql --json > schema.json

By default gql2ts looks for schema.json in the workspace root folder. You can configure the location of schema.json with extension setting gql2ts.schemaJson: 'path/to/shema.json'.

Extension Settings

This extension contributes the following settings:

  • gql2ts.schemaJson: path to project's schema.json

Known Issues

At the time of writing, apollo-codegen npm is not working as expected.

Workaround: fork/clone apollo-codegen repo, build, then npm link the resulting node_module.

Release Notes

0.1.0

Initial release

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft