sangria-graphql/sangria

Schema transformation

オープン

#418 opened on 2018/11/12

 (4 件のコメント) (0 件のリアクション) (0 人の担当者)Scala (219 件のフォーク)batch import
featurehelp wanted

Repository metrics

Stars
 (1,961 個のスター)
PR merge metrics
 (平均マージ 8d 15h) (30d で 4 merged PRs)

説明

The idea is to provide an easy and convenient way to transform existing schema. Since all types are cross-referenced within the schema, the whole schema needs to be re-created in a similar way as in the AST materializer where it re-creates existing types with the help of the builder.

In this case a dedicated builder might be useful as a low-level implementation detail. But it also would be nice to have a high-level DSL. Here is just an idea of how it might look like:

val newSchema =
  schema
    .mapObjectType("Book", _.rename("Publication"))
    .mapOutputTypes(_.filterFileds(field ⇒ !field.tags.contains(Preview)))

コントリビューターガイド