Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Fix foreign key check on connection objects
Browse files Browse the repository at this point in the history
  • Loading branch information
deekerno committed Nov 20, 2023
1 parent 0e62ae1 commit 75bd82a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/fuel-indexer-graphql/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -798,14 +798,14 @@ impl SelectionNode {
arguments,
parent_obj,
} => {
println!("{arguments:#?}");
if let Some(parent_entity) = parent_obj {
if let Some(fk_map) = schema
.foreign_key_mappings()
.get(&parent_entity.to_lowercase())
{
let key = name.replace("Connection", "");
if let Some((fk_table, fk_field)) =
fk_map.get(&entity.to_lowercase())
fk_map.get(&key.to_lowercase())
{
let outer_obj_node =
dependency_graph.add_node(format!(
Expand All @@ -821,7 +821,7 @@ impl SelectionNode {
));
let connecting_node =
dependency_graph.add_node(format!(
"{}.{}s_{}",
"{}.{}s_{}s",
schema.fully_qualified_namespace(),
parent_entity.to_lowercase(),
entity.to_lowercase(),
Expand Down

0 comments on commit 75bd82a

Please sign in to comment.