I would like to return and use a GraphQL Union from a Cell
something like this, but I can’t get it to work
I make a call and most times I get an answer and sometimes the answer is going to take a looooooong time to come back and I get a message to that effect and an authorized url to poll against
export const QUERY = gql`
type AnswerRecord {
answer
question
business
reduction
access
}
type AnswerPoller {
message
authorization
}
union AnswerResult = AnswerRecord | AnswerPoller
query AnswerQuery {
answer AnswerResult
}
`
export const Loading = () => <div>Loading...</div>
export const Empty = () => <div>Empty</div>
export const Failure = ({ error }) => <div>Error: {error.message}</div>
export const Success = ({ answer }) => {
return JSON.stringify(answer)
}