File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { v4 as uuidv4 } from 'uuid';
6
6
* @param {Object } categories
7
7
*/
8
8
const Categories = ( { categories } ) => {
9
+
9
10
return (
10
11
< >
11
12
@@ -16,10 +17,11 @@ const Categories = ({ categories }) => {
16
17
{ categories . map ( ( { name } ) => (
17
18
< div
18
19
key = { uuidv4 ( ) }
19
- className = "flex flex-col justify-around p-6 xs:w-1/2 md:w-1/3 xl:w-1/4"
20
+ className = "flex flex-col justify-around p-6 cursor-pointer xs:w-1/2 md:w-1/3 xl:w-1/4"
20
21
>
21
22
< div className = "flex items-center justify-center w-full h-16 text-center border border-gray-300 rounded-lg shadow hover:shadow-outline" >
22
23
< p className = "text-lg" > { name } </ p >
24
+
23
25
</ div >
24
26
</ div >
25
27
) ) }
Original file line number Diff line number Diff line change @@ -107,10 +107,12 @@ export const FETCH_ALL_PRODUCTS_QUERY = gql`
107
107
* Fetch all categories from GraphQL
108
108
*/
109
109
export const FETCH_ALL_CATEGORIES_QUERY = gql `
110
- query MyQuery {
111
- productCategories {
110
+ query Categories {
111
+ productCategories(first: 10) {
112
112
nodes {
113
+ id
113
114
name
115
+ slug
114
116
}
115
117
}
116
118
}
You can’t perform that action at this time.
0 commit comments