Lab - Query Practice
Lab - Query Practice
Lab - Query Practice
In this query, we will ask for the first 2 products, their IDs, name, and default image URL at resolutions of 200px, 400px, and 600px. We will also use aliases to be able to tell the difference between image resolutions in the response.
root, site field, and products field. Specify next to the products field that we only want 2 products in the response.node: entityId, name, and default image.width:200, width:400, and width:600 next to separate url requests.In this query, we will ask to see pricing information based on the customer’s set price list. Before you begin this exercise, make sure you have a price list set up and assigned to a customer group. Read the article below for more information about Price Lists.
Before you begin this exercise, make sure you have a price list set up and assigned to a customer group. Also, make sure you have a registered customer assigned to the same customer group.
root, site field, and products field. Specify that we only want to view the first 3 products in this query, as well as the entityId, name, and price value.login mutation to log in as a customer who is in a customer group associated with a price list.If you are already logged in as a customer make sure that the customer is in the correct group to receive your specialty price list prices.
5. In the GraphQL Playground, open a new tab and begin writing the query with the root, and customer field. Specify that we want the customer’s firstName and lastName.
site request information from the previous steps to this query.In this query, we will ask for the name and value of a product’s custom fields. To successfully complete this step, you will need to have a product with at least one custom field. Read the article below for more information about custom fields.
root, site field, and product field. Specify the product ID next to the product field and that we want to query for the product’s name and custom fields.In this query, we will ask for a product’s options and variant information.
root, site field, and product field. Specify the product ID next to the product field and that we want to query for the productOptions, entityId, and displayName. Be sure to select the ID of a product in your store that has some variants and options built into it.variants field and specify that we want to see the variant entityId, sku, and price.