Querying Attributes
Inside this guide:
Introduction
Query for an Attribute
Next steps
Introduction
The coreProductAttribute query allows you to query an Attribute.
Query for an Attribute
Constructing the mutation and input
We'll be using the API Console to save time having to authenticate. Copy and paste this into your API console query section to get started. Reminder that fields can be removed from the query if you don't want the API to return them.
POST /graphql
Query
query ($id: String!) {
coreProductAttribute(id: $id) {
id
name
type
}
}
Defining the variables
Copy and paste the block below into the query variables section of the API console and substitute the id with the id of the attribute you want to retrieve.
Variables
{
"id": ATTRIBUTE_ID
}
Now press Execute Query (the play button) to send the request.
You should get back this response that doesn't have any errors, this confirms the attribute has been deleted.
JSON Response
{
"data": {
"coreProductAttribute": {
"id": "73c513ce-c584-46e4-9c51-ddb7aba22575",
"name": "Electronics",
"type": "TEXT"
}
}
}
Next Steps
- Create Attribute - Learn how to create an attribute
- Query Attribute - Learn how to query an attribute
- Update Attribute - Learn how to update an attribute
- Delete Attribute - Learn how to delete an attribute
- Making your first call - If you're not sure how GraphQL works, start here.