Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const LayoutTodo = ({userId}) => {
console.log('LayoutTodo', userId, isServer);
const {props, error, retry, cached} = useQuery(
QueryApp,
{userId},
{
fetchPolicy: 'store-and-network',
},
);
/*const { props, error, retry, cached } = useQuery({
query: QueryApp,
variables: {
// Mock authenticated ID that matches database
userId,
},
dataFrom: "STORE_THEN_NETWORK"
});*/
console.log('renderer', props, cached);
const Home = () => {
const {error, cached, props, retry} = useQuery(
query,
variables,
{
fetchPolicy: STORE_OR_NETWORK,
},
);
if (props) {
return ;
} else if (error) {
return <div>{error.message}</div>;
}
return <div>loading</div>;
};
const Home = () => {
const {error, cached, props, retry} = useQuery(
query,
variables,
{
fetchPolicy: STORE_OR_NETWORK,
},
);
if (props) {
return ;
} else if (error) {
return <div>{error.message}</div>;
}
return <div>loading</div>;
};