Skip to content

Commit

Permalink
Fix SDLSchema replacing logic
Browse files Browse the repository at this point in the history
Reviewed By: alunyov

Differential Revision: D52699337

fbshipit-source-id: 8297db2c96653c0cdb7e442ae6b16ff4b7518bab
  • Loading branch information
Deepak Singh authored and facebook-github-bot committed Jan 12, 2024
1 parent d90dedf commit ece1fd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/crates/schema/src/in_memory/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ impl InMemorySchema {
id: InputObjectID,
input_object: InputObject,
) -> DiagnosticsResult<()> {
if id.as_usize() >= self.enums.len() {
if id.as_usize() >= self.input_objects.len() {
return todo_add_location(SchemaError::UnknownTypeID(
id.as_usize(),
String::from("Input Object"),
Expand All @@ -629,7 +629,7 @@ impl InMemorySchema {
/// Replaces the definition of union type, but keeps the same id.
/// Existing references to the old type now reference the replacement.
pub fn replace_union(&mut self, id: UnionID, union: Union) -> DiagnosticsResult<()> {
if id.as_usize() >= self.enums.len() {
if id.as_usize() >= self.unions.len() {
return todo_add_location(SchemaError::UnknownTypeID(
id.as_usize(),
String::from("Union"),
Expand Down

0 comments on commit ece1fd9

Please sign in to comment.