In GraphQL describe an alternating field?

Tell me, it so happened that there is a need, depending on the value of one field to change the contents of another, a purely synthetic example below:

{
 "type": "in",
 "payload": {
 "text": "Hello"
}
}


{
 "type": "service",
 "payload": {
 "type": "NEW_MESSAGE"
}
}


That is, depending on the value of type can be different payload, tell me how to specify in the scheme such conditionals?
June 8th 19 at 17:18

Find more questions by tags GraphQL