rbi-learning / Today-I-Learned

1 stars 0 forks source link

Today I learned 8/19 #163

Open amatheus000 opened 4 years ago

amatheus000 commented 4 years ago

Morning Exercise

We learned to use GraphQL to query customizable sections of an object. This allows you to target the specific part you want to get from an array.

For example, in today's morning exercise we queried the product's categories for the name, primary image URL and carousel image URL.

The query looked like this:

query { allCategory{ name, primaryImage{asset{url}}, carouselImage{asset{url}} } }

Note: Overflow: scroll in CSS to update the cart so that when new items are added to the cart, it doesn’t overflow over the dialog's window.