Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function PostList() {
const [allPostsResult] = useQuery({
query: allPostsQuery,
variables: allPostsQueryVars,
});
if (allPostsResult.error) {
return ;
} else if (allPostsResult.loading || !allPostsResult.data) {
return <div>Loading</div>;
}
const { allPosts, _allPostsMeta } = allPostsResult.data;
return (
<section>
<ul>
{allPosts.map((post, index) => (</ul></section>
export default function DocumentsProvider(props: Props) {
const [
{ data: currentUserData, fetching: userFetching },
refetchCurrentUser,
] = useQuery({
query: currentUserQuery,
requestPolicy: "network-only",
});
const [{ data: docsData }, refreshDocsData] = useQuery({
query: documentsQuery,
requestPolicy: "network-only",
});
const [, saveDocumentAction] = useMutation<
SaveDocumentMutationResponse,
SaveDocumentMutation
>(saveDocumentMutation);
const [, deleteDocumentAction] = useMutation<
DeleteDocumentMutationResponse,
DeleteDocumentMutation
>(deleteDocumentMutation);
const [, login] = useMutation(