LoginSignup
2
0

More than 1 year has passed since last update.

GraphQL Tools気になるやつ

Last updated at Posted at 2021-12-23

この記事はGraphQL Advent Calendar 2021の23日目の記事です。


最近、GraphQL Toolsというサイトを知りました。

The GuildというOSS開発者の団体が管理しているGraphQL系のOSSツール群らしい。

ここが管理するものをざっと眺めてみて気になったものを、備忘録程度にピックアップしておきます。

graphql-inspector

Validate schema, get schema change notifications, validate operations, find breaking changes, look for similar types, schema coverage

  • schemaを分析して色々できるやつ
  • リリース時に前のバージョンと比べてbreaking changeがないか確認するとかで使えそう
  • 大規模開発とか公開しているAPIのリリースノート作成など、使い所はたくさんありそう

  • GithubActionも公開されている
    https://github.com/marketplace/actions/graphql-inspector

@graphql-tools/mock

  • モックライブラリ
  • テストの時や、resolverが完成していないけどフロントの開発をしたい時などに使えそう

graphql-code-generator

  • 色んなファイルに書かれたschemaを一つに統合したり、schemaファイルから様々なコードファイル(typescriptの型定義ファイルとか)を生成できる
  • 様々なpluginが用意されているので、生成したいコードに合わせたpluginを使う

(graphql-code-generatorは有名なので、色んな所で使われてそう)

graphql-eslint

  • GraphQLのshemaとoperationにlintを効かせるためのESlintプラグイン
  • カスタムルールなどで拡張するのが簡単らしい > Easily extendable - supports custom rules based on GraphQL's AST and ESLint API

GraphQL Scalars

  • GraphQLがデフォルトで提供するScalar type以外で汎用的に使えそうなScalar typeを提供するライブラリ
  • NotEmptyString,BigInt,PositiveFloatや、Email,PostalCodeなどがある
  • かゆいところに手が届くものが提供されていて、結構使い勝手よさそう

おわりに

色々と便利なツールが開発されていました。
モックやlint系のツールは他の場所でも開発がされていそうだけど、
必要になったときはGraphQL Toolsも候補にいれていいかもしれないです。

2
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
2
0