I have the following schema:
enum PaymentTypeName {
PAYMENT_CARD
PAYMENT_CARD_TOKEN
}
interface Payment {
id: ID!
type: PaymentTypeName!
}
type PaymentCardPayment implements Payment {
id: ID!
type: PaymentTypeName!
card: PaymentCard!
}
type PaymentCardTokenPayment implements Payment {
id: ID!
type: PaymentTypeName!
card: PaymentCard!
}
When Payment
is PaymentCardPayment
or PaymentCardTokenPayment
is determined by the value of type, i.e. it is either PAYMENT_CARD
or PAYMENT_CARD_TOKEN
.
How do I signify in the interface, that PaymentCardPayment
/ PaymentCardTokenPayment
inherit a specific value of PaymentTypeName
?
I have tried various combinations of:
type PaymentCardPayment implements Payment {
id: ID!
type: PaymentTypeName.PAYMENT_CARD!
card: PaymentCard!
}
and:
type PaymentCardPayment implements Payment {
id: ID!
type: PaymentTypeName[PAYMENT_CARD]!
card: PaymentCard!
}
but all of these prompt a syntax error and I was unable to find the relevant documentation.