ppx_graphqlversion
Write type-safe GraphQL queries
Given a introspection query response in schema.json
, the expression [%graphql {| query { ... } |} ]
is rewritten to a 3-tuple (query, kvariables, parse)
:
query
(typestring
) is the GraphQL query to be submitted.kvariables
(type(Yojson.Basic.json -> 'a) -> arg1:_ -> ... -> argn:_ -> unit -> 'a
) is a function to construct the JSON value to submit as query variables. The labels and types ofargx
are extracted from the query. Required variables appear as labeled arguments, optional variables appear as optional arguments.parse
is a function for parsing the JSON response from the server and has the typeYojson.Basic.json -> < ... >
. The shape of the object type corresponds to the returned response.
Author | Andreas Garnaes <andreas.garnaes@gmail.com> |
---|---|
Published | |
Homepage | https://github.com/andreas/ppx_graphql |
Issue Tracker | https://github.com/andreas/ppx_graphql/issues |
Maintainer | Andreas Garnaes <andreas.garnaes@gmail.com> |
Dependencies | |
Source [http] | https://github.com/andreas/ppx_graphql/releases/download/0.1.0/ppx_graphql-0.1.0.tbz sha256=1e4bce08f9219140711fa685ab3908c81e0c67379149fc2268cd427f1a991ac8 md5=867fd458e920f747f5557fdba257ce12 |
Edit | https://github.com/ocaml/opam-repository/tree/master/packages/ppx_graphql/ppx_graphql.0.1.0/opam |
No package is dependent