GraphQL Query Rewriter

GraphQL Query Rewriter

GraphQL Schema Rewriter can rewrite much more complex queries than just changing a single input type as well. This middleware goes directy before your handler in express:

rewrites the type of an argument to a graphQL query or mutation. For example, to migrate the mutation to a mutation with a proper output payload type like:

we can make this change with the following rewriter:

For example, This would rewrite the following mutation:

and turn it into:

Currently GraphQL Query Rewriter can only work with a single operation per query, and cannot properly handle aliased fields.

Source: github.com