This projects helps us generating OCaml code based on a graphql code.
Build more, write less.
This project is an atempt to transform the process of building graphql api into something faster and esier.
This is super useful to work with .graphql files and use them inside our ocaml application.
Cli:
-o
- where to store the generated code (optional) (default: "schema.ml")- filename - Graphql code to compile (required)
Exampels are located inside the examples folder.
Receiving a Graphql file like this:
schema {
query: MyQuery
}
type MyQuery {
Hello: String!
}
Will give us a OCaml file like this:
open Graphql_lwt;;
type 'ctx schema = { hello: 'ctx Schema.resolve_info -> unit -> string; };;
let schema schema_from_typ = let open Schema in
Schema.schema [
field "Hello" ~typ:(non_null string) ~args:Arg.[]
~resolve:schema_from_typ.hello;
];;
This project is inspired by the gqlgen built with Golang.
- Create a basic CLI
- Run tests
- Compile graphql code
- Upgrade the identation with Format module
- Add support to types with methods
- Add support to the schema initialization
- Reorganize the project
- Add more documentation
- Write more exampels and tests
- Test the code with a simple Graphql Application
- Add support for mutation schema
- Add graph dependency