Graphiti icon indicating copy to clipboard operation
Graphiti copied to clipboard

How would you make a connection of a union? Is this possible right now?

Open cshadek opened this issue 4 years ago • 3 comments

My understanding is that unions are defined using protocols and that protocols, and the Node type in a connection needs to implement Encodable. Is it possible to make a connection for a union type?

cshadek avatar Nov 11 '20 16:11 cshadek

Hey, @cshadek. Sorry for the delay. Yeah, I think that's the case, indeed. I have some idea of how we could solve that by creating something like a ProtocolCodable protocol which would allow us to encode and decode protocols. That would require runtime registration of concrete types, though, which might be cumbersome.

paulofaria avatar Feb 10 '21 17:02 paulofaria

Let me know if you want to work on something like this and I can help with suggestions, etc.

paulofaria avatar Feb 10 '21 17:02 paulofaria

@NeedleInAJayStack given the recent focus on improving connections, it might make sense to revisit this. Do you have an idea of how this might be achieved? The current solution is to create a wrapper type that has a field referring to the union or protocol, but this is obviously not ideal.

cshadek avatar Mar 13 '23 15:03 cshadek