You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if the problems is a misunderstood from my side, if i am using interface wrong or if it is an issue. The problem is related to using an interface when i implement the interface to my models (via impl not struct) the definition of the interface is not in the result schema i have to define it in the implementation but then it uses the interface method.
Let me explain it better, i am doing an initial POC implementing the relay schema (at the moment not conections) to see how to have relay support in Juniper so i created the following:
As you can see i added the id function resolver to each of the implementation so now it is duplicated but the schema is how i want it to be.
When i consume any of the model throw the NodeValue for examlpe for NodeValue::Ship() (like the node(id: "") query) the id is resolved by the impl Node for Ship interface but if i have a simple relation like Vec<Ship> this is resolved by ´impl Ship´ function but i expect to always use the id function from impl Node for Ship.
So my question is, is it the expected behaviour and i understood wrong? is the implementation wrong on my side? do you think it is a bug?
The text was updated successfully, but these errors were encountered:
Hi,
I don't know if the problems is a misunderstood from my side, if i am using interface wrong or if it is an issue. The problem is related to using an interface when i implement the interface to my models (via impl not struct) the definition of the interface is not in the result schema i have to define it in the implementation but then it uses the interface method.
Let me explain it better, i am doing an initial POC implementing the relay schema (at the moment not conections) to see how to have relay support in Juniper so i created the following:
I created a
Node
interface with anid
function and each model has theNode
implementation for the interface, the result of this schema is:From what i understand this is not correct and the schema result should be:
If i want to have this definition i should have the following rust implementation:
As you can see i added the
id
function resolver to each of the implementation so now it is duplicated but the schema is how i want it to be.When i consume any of the model throw the
NodeValue
for examlpe forNodeValue::Ship()
(like the node(id: "") query) the id is resolved by theimpl Node for Ship
interface but if i have a simple relation likeVec<Ship>
this is resolved by ´impl Ship´ function but i expect to always use theid
function fromimpl Node for Ship
.So my question is, is it the expected behaviour and i understood wrong? is the implementation wrong on my side? do you think it is a bug?
The text was updated successfully, but these errors were encountered: