import { useMemo } from "react" ; import { BaseQueryOptions , useQuery } from "@apollo/client" ; import GET_RECIPE_QUERY from "graphql/queries/getRecipe" ; param BaseQueryOptions const useRecipe = ( queryOptions ? ) => { const { data , loading } = useQuery ( GET_RECIPE_QUERY , queryOptions ) ; const payload = useMemo ( ( ) => ( { data : data ?. recipe , loading , } ) , [ data , loading , ] ) ; return payload ; } ; export default useRecipe ;