package graphql_ppx

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

Install

Dune Dependency

Authors

Maintainers

Sources

v1.0.1.tar.gz
md5=bcf43590b569405282f698ad5bdb45f9
sha512=644479f8fc2760cf202c4bce04cb5cf6e1a8f38fcc9a68583c92b8c4fe614c58d4d28e29a21935ef01f3b049d3ebea14ae6eaebf01000ec2a69cf62105338d8a

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.