I'll update as I find more, right now need to update the src/hooks/Category/useCategorySeo.js file. The only one uses the category query, which doesn't work with UID.
import { useMemo } from "react";
import { useQuery } from "@apollo/client";
import gql from "graphql-tag";
const GET_CATEGORY_SEO = gql`
query getCategorySeo($id: String!) {
categories(filters: { category_uid: { in: [$id] } }) {
# eslint-disable-next-line @graphql-eslint/require-id-when-available
items {
uid
mw_canonical_url {
url
code
}
meta_robots
mw_hreflangs {
items {
url
code
}
}
mw_seo_markup {
social_markup
rich_snippets {
website
seller
}
}
}
}
}
`;
const useProductAttachments = (props) => {
const { id } = props;
const { error, loading, data } = useQuery(GET_CATEGORY_SEO, {
fetchPolicy: "cache-and-network",
nextFetchPolicy: "cache-first",
variables: {
id
}
});
const seoAttributes = useMemo(() => {
if(data && data.categories.items.length){
return data.categories.items[0];
}
return null;
}, [data]);
return {
error,
loading,
seoAttributes
};
};
export default useProductAttachments;