import { useQuery } from '@apollo/react-hooks' const Query = ({ children, query, id }) => { const { data, loading, error } = useQuery(query, { variables: { id } }) if (loading) { return (

loading...

) } if (error) return

Error: {JSON.stringify(error)}

return children({ data }) } export default Query