Extremely fast GraphQL parser and merger.
It can stitch and merge schema files together.
Merging schema files:
gqlt merge ./file1.graphql ./file2.graphql ./combined.graphql
or even, when your shell (e.g. zsh) supports it:
gqlt merge ./graphql/**/*.graphql ./combined.graphql
The last path is the output file.
note: bash is also supported for recursive globs (path/**/*.gql) with shopt -s globstar
--sort: sort the definitions and fields by name in the merged document.
brew install digiz3d/tap/gqlt
Made 100% with Zig.
No dependencies.
Run zig build.
gqlt will be compiled for your current platform here: ./zig-out/bin/gqlt.
Tools we compare gqlt with:
@graphql-tools/merge
gqlmerge
| gqlt | @graphql-tools/merge | gqlmerge | |
|---|---|---|---|
| Speed | fastest 🚀 | slow | fast |
| Limitations |
|
none |
|
| Indentation | ✅ | ✅ | ❌ inconsistent |
| Sort definitions | ✅ | ✅ | ❌ |
| Descriptions | ✅ | ✅ | ✅ |
| Comments | ❌ | ❌ | ✅ |
| Double quotes in block strings | ✅ | ✅ | ❌ |
see benchmarks
By doing this project, my goals were to
- learn Zig
- write my first, real parser
- implement some benchmark
- gqlmerge. Even if it did not work for my use case, it is a great tool for simpler projects. Learnt a lot from it !
- astexplorer for visual representation of the JS GraphQL parser output.
- GraphQL specification for the grammar and the syntax.
