import React from 'react'; import { gql, useQuery } from 'urql'; const RANDOM_COLOR_QUERY = gql` query RandomColor { randomColor { name hex } } `; const RandomColorDisplay = () => { const [result] = useQuery({ query: RANDOM_COLOR_QUERY }); const { data, fetching, error } = result; return (
Loading...
} {error &&Oh no... {error.message}
} {data && (To get a result, the retry exchange retried:{' '} {result.operation.context.retryCount || 0} times.
)}