Skip to content

Commit 1d155d9

Browse files
committed
Add VARIABLE_DEFINITION directive location
I have some schemas that have this directive location, and this crate currently crashes while trying to parse it.
1 parent 07c557b commit 1d155d9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/schema/ast.rs

+4
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ pub enum DirectiveLocation {
401401
EnumValue,
402402
InputObject,
403403
InputFieldDefinition,
404+
VariableDefinition,
404405
}
405406

406407
#[derive(Debug, Clone, PartialEq)]
@@ -451,6 +452,7 @@ impl DirectiveLocation {
451452
EnumValue => "ENUM_VALUE",
452453
InputObject => "INPUT_OBJECT",
453454
InputFieldDefinition => "INPUT_FIELD_DEFINITION",
455+
VariableDefinition => "VARIABLE_DEFINITION",
454456
}
455457
}
456458

@@ -478,6 +480,7 @@ impl DirectiveLocation {
478480
| EnumValue
479481
| InputObject
480482
| InputFieldDefinition
483+
| VariableDefinition
481484
=> false,
482485
}
483486
}
@@ -517,6 +520,7 @@ impl FromStr for DirectiveLocation {
517520
"ENUM_VALUE" => EnumValue,
518521
"INPUT_OBJECT" => InputObject,
519522
"INPUT_FIELD_DEFINITION" => InputFieldDefinition,
523+
"VARIABLE_DEFINITION" => VariableDefinition,
520524
_ => return Err(InvalidDirectiveLocation),
521525
};
522526

0 commit comments

Comments
 (0)