Slackbot
07/16/2021, 1:04 AMTony Won
union
타입이나 interface
로 분리하는게 좋을거같아요.
query {
user {
__typename
password
... on UserWithEmail {
email
}
... on UserWithAddress {
address
}
}
}
Tony Won
union User = UserWithEmail | UserWithAddress
type UserWithEmail {
email: String!
password: String!
}
type UserWithAddress {
address: String!
password: String!
}
Interface:
interface User {
password: String!
}
type UserWithEmail implements User {
email: String!
password: String!
}
type UserWithAddress implements User {
address: String!
password: String!
}
박연호
07/23/2021, 7:14 AM