Graphiti
Graphiti copied to clipboard
How would you make a connection of a union? Is this possible right now?
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?
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.
Let me know if you want to work on something like this and I can help with suggestions, etc.
@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.