Fixes #911
This commit is contained in:
parent
de4f908812
commit
96e423ff31
|
@ -33,8 +33,8 @@ pub enum MetaTypeName<'a> {
|
|||
Named(&'a str),
|
||||
}
|
||||
|
||||
impl<'a> std::fmt::Display for MetaTypeName<'a> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
impl<'a> Display for MetaTypeName<'a> {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
MetaTypeName::Named(name) => write!(f, "{}", name),
|
||||
MetaTypeName::NonNull(name) => write!(f, "{}!", name),
|
||||
|
@ -388,7 +388,7 @@ impl MetaType {
|
|||
pub struct MetaDirective {
|
||||
pub name: &'static str,
|
||||
pub description: Option<&'static str>,
|
||||
pub locations: Vec<model::__DirectiveLocation>,
|
||||
pub locations: Vec<__DirectiveLocation>,
|
||||
pub args: IndexMap<String, MetaInputValue>,
|
||||
pub is_repeatable: bool,
|
||||
pub visible: Option<MetaVisibleFn>,
|
||||
|
|
|
@ -69,7 +69,11 @@ pub fn is_valid_input_value(
|
|||
return None;
|
||||
}
|
||||
|
||||
match registry.types.get(type_name).unwrap() {
|
||||
match registry
|
||||
.types
|
||||
.get(type_name)
|
||||
.unwrap_or_else(|| panic!("Type `{}` not defined", type_name))
|
||||
{
|
||||
registry::MetaType::Scalar { is_valid, .. } => {
|
||||
if is_valid(&value) {
|
||||
None
|
||||
|
|
Loading…
Reference in New Issue