Running a basic query with the useQuery() hook fails with the above error. The same query works using the <Query /> component.
Reproduction: https://codesandbox.io/s/9zl9v10xzr
You're passing a string go useQuery but it accepts a couple of options :) please check the docs on the exact usage of this hook. The shortest intro can be found here: https://github.com/FormidableLabs/urql/blob/master/docs/getting-started.md#using-hooks
There's also a small API doc. The docs will all be available as a site soon. :)
Ohhh. Heads up @kitten, the example in root level README.md passes a string instead of an options object.
import { useQuery } from 'urql';
const YourComponent = () => {
const [{ fetching, data }] = useQuery(`{ todos { id } }`);
return fetching ? <Loading /> : <List data={data.todos} />;
};
Oh super sorry about that! I'll fix that up. Thanks for the heads up 鉂わ笍
Most helpful comment
Oh super sorry about that! I'll fix that up. Thanks for the heads up 鉂わ笍