0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【VSCode】GraphQLのクエリの定義からschemaファイルを参照できる拡張機能

Posted at

概要

VSCodeで、GraphQLのクエリ定義からschemaファイルを参照できる拡張機能があったので、少し紹介したいと思います。

拡張機能のセットアップ

  • 拡張機能はGraphQL: Language Feature Supportになります。まずはこちらをインストールします。
  • .graphqlrc.ymlにてschemaファイルと、クエリを定義するファイル(documents)を設定します。TypeScriptにてクエリを定義する場合は、上記の拡張機能のページにあるように以下のような設定になります。
.graphqlrc.yml
schema: 'schema.graphql'
documents: 'src/**/*.{graphql,js,ts,jsx,tsx}'

できること

以下のキャプチャーのように、クエリを定義してるファイルからschemaファイルの定義に参照できるような感じになります。

また、以下のようにクエリを書くときのサジェストもしてくれます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?