Crates.io | graphql-schema-validation |
lib.rs | graphql-schema-validation |
version | 0.1.3 |
source | src |
created_at | 2023-10-31 15:22:47.242551 |
updated_at | 2024-02-06 18:23:19.948447 |
description | A spec compliant implementation of GraphQL SDL schema validation |
homepage | |
repository | https://github.com/grafbase/grafbase/tree/main/engine/crates/validation |
max_upload_size | |
id | 1019922 |
size | 70,103 |
This crate implements GraphQL SDL schema validation according to the 2021 version of the GraphQL spec.
Scope:
use graphql_schema_validation::validate;
fn main() {
let graphql = "schema { query: MyQueryDoesNotExist }";
let diagnostics = validate(graphql);
assert!(diagnostics.has_errors());
let formatted_diagnostics = diagnostics.iter().map(|err| format!("{}", err)).collect::<Vec<String>>();
assert_eq!(formatted_diagnostics, ["Cannot set schema query root to unknown type `MyQueryDoesNotExist`"]);
}
The crate is being actively developed and maintained. It covers the spec completely and faithfully, as far as we are aware.