sangria-graphql/sangria

Schema transformation

Offen

#418 geöffnet am 12.11.2018

 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Scala (219 Forks)batch import
featurehelp wanted

Repository-Metriken

Stars
 (1.961 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 8T 15h) (4 gemergte PRs in 30 T)

Beschreibung

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)))

Contributor Guide