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 useEssays ({ query, variables }) {
const { result, loading, error } = useQuery(query, variables)
const essays = useResult(result, null, (data) => {
if (data.peceEssays && data.peceEssays.items.length) { return data.peceEssays.items }
return null
})
return {
essays,
loading,
error
}
}
export default function useRoute ({ query, variables }) {
const { result, loading, error } = useQuery(query, variables)
const data = useResult(result, null, (data) => {
if (data.route) { return data.route }
return null
})
return {
data,
loading,
error
}
}