0
1

More than 3 years have passed since last update.

PostGraphile: クエリー名をシンプルにする方法

Posted at

PostGraphileで、GraphQLのクエリー名をシンプルにする方法です。次の図のようになります。

PostGraphileのクエリー名をシンプルにする方法

PostGraphileでクエリー名をシンプルにするには、@graphile-contrib/pg-simplify-inflectorプラグインを使います。

まず、このプラグインをインストールします:

yarn add @graphile-contrib/pg-simplify-inflector

そして、postgraphileを起動するときに次のCLIオプションを指定して、このプラグインを使うようにします。

--append-plugins @graphile-contrib/pg-simplify-inflector

# 起動例
pnpx postgraphile \
  --connection postgres:///postgres \
  --append-plugins @graphile-contrib/pg-simplify-inflector

これで、GraphQLのクエリー名がシンプルになります。

ちなみに、このプラグインを使うのは推奨されているようです。

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