-
Notifications
You must be signed in to change notification settings - Fork 457
Open
Description
At 9:17, this code:
const [{ data, fetching }] = usePostsQuery({
variables,
});
is causing an error:
TypeError: (0 , generated_graphql__WEBPACK_IMPORTED_MODULE_4_.usePostsQuery) is not a function or its return value is not iterable
The difference between Ben's updoot branch is that his generated/graphql has got an export as:
export function usePostsQuery(options: Omit<Urql.UseQueryArgs<PostsQueryVariables>, 'query'> = {}) {
return Urql.useQuery<PostsQuery>({ query: PostsDocument, ...options });
};
Mine does not. I did run the generator successfully and my generated/graphql does include a Query for posts. It does not however have the above export function.
How do I look for the source of this problem? I'm trying to learn as much as I'm trying to solve this particular problem. Any advice for how to approach problem solving would be gratefully received. I thought the generated/graphql file was created by running yarn gen.
Thank you
Metadata
Metadata
Assignees
Labels
No labels