package graphql_ppx

  1. Overview
  2. Docs
GraphQL PPX rewriter for ReScript/ReasonML

Install

Dune Dependency

Authors

Maintainers

Sources

v1.2.2.tar.gz
md5=00455e2a595b925a697fd7e80aab3fb8
sha512=b6e0a5b353b6498c10d03a37ab4a2083ca0d17f227fa906e7c6f07053a7a9198476b7aa7d0e88f4e3c8c44a85469eb3a65805cd6d006ef64ff82fe5bc3524881

doc/graphql_ppx.base/Graphql_ppx_base/Ast_transforms/index.html

Module Graphql_ppx_base.Ast_transforms

* An AST transform will take the schema and a document, and transform the AST * of the document returning the same document type * * With these transforms we can slightly change the GraphQL operation or * fragment compared to what the user supplies. This is helpful for instance * to add fields that clients will add implicitly, or to preprocess the document * to conform to some of the conventions of graphql-ppx.

val add_typename_to_selection_set : t

* This is a GraphQL AST transform that will add the __typename to all selection * sets. This is necessary for Apollo, as this is an implicit field. * If we don't include this when using Apollo, the __typename information is * lost when we parse values and then serialize back to the js-values again

val remove_typename_from_union : t

* This is a GraphQL AST transform that removes the `__typename` field from * unions. The PPX will add this in the printer stage, so it is always there. * The PPX will not allow any scalar fields on a union except for the inline * fragments, so we make sure to remove it before doing any further processing.

OCaml

Innovation. Community. Security.