graphql-tools
(Rust)
Documentation | Crate | GitHub
Note: this crate is still under development (see roadmap below)
The graphql_tools
crate implements tooling around GraphQL for Rust libraries. Most of the tools are based on trait
s and struct
s implemented in graphql_parser
crate.
The goal of this library is to create a common layer of tools that has similar/improved APIs to graphql-js
reference implementation and graphql-tools
from the JS/TS ecosystem.
Getting Started
Add graphql-tools
as a dependency of your project by adding the following to your Cargo.toml
file:
[]
= "..."
Or, if you are using cargo-edit
:
cargo add graphql-tools
Roadmap and progress
- Better documentation
- Visitor:
SchemaVisitor
- Visitor:
QueryVisitor
- GraphQL Validation engine
- Validation rules (in-progress)
If you have an idea / missing feature, feel free to open an issue / start a GitHub discussion!
Validation Rules
This comparison is based on
graphql-js
refernece implementation.
- ExecutableDefinitions (not actually needed)
- UniqueOperationNames
- LoneAnonymousOperation
- SingleFieldSubscriptions
- KnownTypeNames
- FragmentsOnCompositeTypes
- VariablesAreInputTypes
- LeafFieldSelections
- FieldsOnCorrectType
- UniqueFragmentNames
- KnownFragmentNames
- NoUnusedFragments
- PossibleFragmentSpreads
- NoFragmentCycles
- UniqueVariableNames
- NoUndefinedVariables
- NoUnusedVariables
- KnownDirectives
- UniqueDirectivesPerLocation
- KnownArgumentNames
- UniqueArgumentNames
- ValuesOfCorrectType
- ProvidedRequiredArguments
- VariablesInAllowedPosition
- OverlappingFieldsCanBeMerged
- UniqueInputFieldNames