Skip to main content
Answer

Unable to model a direct relationship as required field in a view using UI

  • March 22, 2023
  • 4 replies
  • 102 views

type Employee {

name: String!

department: Department!

}

type Department {

name: String!

}

I can't model a use case where an employee must belong to a department.

Best answer by Dilini Fernando

Hi @Shreyas Mehta,

I hope Anders’s reply was helpful. I’m closing this topic now, please feel free to create a new post if you have any questions.  

Br,
Dilini

4 replies

Anders Hafreager
Practitioner

Correct. As of today, we don’t support required relation fields like that.


  • Author
  • Seasoned
  • March 23, 2023

@Anders Hafreager - Is there a work around for this? If not, do you plan to fix this by GA?

Being able to ensure that an employee will always belong to a department is a very common use case in data modeling. 


Anders Hafreager
Practitioner

There is no workaround. The reason is the following:

If node X is in space A with a reference to node Y in space B.

If I delete my node Y, but don’t have access to delete your node X, what should happen? 

 

I definitely see the use case, but we will not have a solution for this on the short term.


Dilini Fernando
Seasoned Practitioner
Forum|alt.badge.img+2
  • Seasoned Practitioner
  • Answer
  • April 19, 2023

Hi @Shreyas Mehta,

I hope Anders’s reply was helpful. I’m closing this topic now, please feel free to create a new post if you have any questions.  

Br,
Dilini