just a quick question: is it possible to use "unio...
# prisma-whats-new
j
just a quick question: is it possible to use "unions" with graphql-up?
a
@jfa not sure I follow 😕 what are you trying to accomplish?
j
@artyom im trying to build a schema for a "relativly" complex editor-app and want to collect/connect different modelTypes in a another modelType, like that union Project = SimpleProject | ComplexProject type SimpleProject { id: ID! simpleName: String } type ComplexProject { id: ID! complexName: String } type User { id: ID! name: String projects: [Project] }
a
interesting. I’ll ask @nilan to follow-up with you
j
thx 🙂
n
ah that's not supported, no. But you can either do
Copy code
type User {
 id: ID!
 name: String
 simpleProjects: [SimpleProject]
 complexProjects: [SimpleProject]  
}
or have only one Project model that encodes if it's a simple or complex model
j
ok thank you for your answer, the project union was just one example, there is a lot of this stuff in my appand it needs to be expandable. For that reason i'm searching a solution with unions...