Skip to content

Commit ece1fd9

Browse files
Deepak Singhfacebook-github-bot
authored andcommitted
Fix SDLSchema replacing logic
Reviewed By: alunyov Differential Revision: D52699337 fbshipit-source-id: 8297db2c96653c0cdb7e442ae6b16ff4b7518bab
1 parent d90dedf commit ece1fd9

File tree

1 file changed

+2
-2
lines changed
  • compiler/crates/schema/src/in_memory

1 file changed

+2
-2
lines changed

compiler/crates/schema/src/in_memory/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ impl InMemorySchema {
612612
id: InputObjectID,
613613
input_object: InputObject,
614614
) -> DiagnosticsResult<()> {
615-
if id.as_usize() >= self.enums.len() {
615+
if id.as_usize() >= self.input_objects.len() {
616616
return todo_add_location(SchemaError::UnknownTypeID(
617617
id.as_usize(),
618618
String::from("Input Object"),
@@ -629,7 +629,7 @@ impl InMemorySchema {
629629
/// Replaces the definition of union type, but keeps the same id.
630630
/// Existing references to the old type now reference the replacement.
631631
pub fn replace_union(&mut self, id: UnionID, union: Union) -> DiagnosticsResult<()> {
632-
if id.as_usize() >= self.enums.len() {
632+
if id.as_usize() >= self.unions.len() {
633633
return todo_add_location(SchemaError::UnknownTypeID(
634634
id.as_usize(),
635635
String::from("Union"),

0 commit comments

Comments
 (0)