import React from 'react'; import { gql, useQuery } from 'urql'; const LOCATIONS_QUERY = gql` query Locations($query: String!) { locations(query: $query) { id name } } `; const LocationsList = () => { const [result] = useQuery({ query: LOCATIONS_QUERY, variables: { query: 'LON' }, }); const { data, fetching, error } = result; return (
Loading...
} {error &&Oh no... {error.message}
} {data && (