Skip to Content

manufacturer

Get a single manufacturer by ID.

Query Structure

query { manufacturer(id: ID!) { seoDescription seoTitle seoKeywords id title allProductsCount products { # ProductConnection fields can be selected here } image filters { # Filter fields can be selected here } } }

Arguments

ArgumentTypeDescriptionRequiredDefault
idID!The ID of the manufacturer to retrieveYesN/A

Return Type

Manufacturer

Describes a manufacturer.

FieldTypeDescription
seoDescriptionString (optional)Returns description for search engines.
seoTitleString (optional)Returns title for search engines.
seoKeywordsString (optional)Returns keywords for search engines.
idInt (optional)Returns the ID of the manufacturer.
titleString (optional)Returns the title of the manufacturer.
allProductsCountInt (optional)Returns the total amount of products for this manufacturer.
productsProductConnection (optional)Returns the products associated with this manufacturer.
imageString (optional)Returns the image URL of the manufacturer.
filters[Filter] (optional)Returns the available filters for this manufacturer, null if none is set.

Examples

Basic Query

query { manufacturer(id: 12345) { id title seoDescription } }

Advanced Query

query { manufacturer(id: 12345) { id title seoTitle seoKeywords seoDescription allProductsCount image filters { id name type values { id label } } products { edges { node { id title price available } } pageInfo { hasNextPage endCursor } } } }

Field Selection

query { manufacturer(id: 12345) { title allProductsCount products { edges { node { id title price } } } } }

cURL Example

curl -X POST https://www.mystoreurl.com/graphql/0.8.0/ \ -H "Content-Type: application/json" \ -d '{"query":"query { manufacturer(id: 12345) { id title seoDescription } }"}'

JavaScript Example

async function fetchManufacturer(manufacturerId) { const query = ` query { manufacturer(id: ${manufacturerId}) { id title seoDescription } } `; try { const response = await fetch('https://www.mystoreurl.com/graphql/0.8.0/', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ query }), }); const { data, errors } = await response.json(); if (errors) { console.error('GraphQL errors:', errors); return null; } return data.manufacturer; } catch (error) { console.error('Network error:', error); return null; } } // Usage example fetchManufacturer(12345).then(manufacturer => { if (manufacturer) { console.log('Manufacturer:', manufacturer); } else { console.log('Failed to fetch manufacturer.'); } });

Response Format

The response contains a manufacturer object with the requested fields. Example:

{ "data": { "manufacturer": { "id": 12345, "title": "Acme Corp", "seoDescription": "Leading manufacturer of quality products.", "seoTitle": "Acme Corp - Quality Products", "seoKeywords": "acme, manufacturer, quality", "allProductsCount": 150, "image": "https://cdn.mystoreurl.com/images/manufacturers/acme.jpg", "filters": [ { "id": 1, "name": "Color", "type": "dropdown", "values": [ { "id": 10, "label": "Red" }, { "id": 11, "label": "Blue" } ] } ], "products": { "edges": [ { "node": { "id": 1001, "title": "Acme Widget", "price": 19.99, "available": true } } ], "pageInfo": { "hasNextPage": true, "endCursor": "cursor123" } } } } }

Error Handling

Error CodeDescriptionHandling Recommendation
BAD_USER_INPUTThe provided id argument is invalid or missing.Validate the id before querying.
NOT_FOUNDNo manufacturer found with the specified id.Inform the user that the manufacturer does not exist.
INTERNAL_SERVER_ERRORUnexpected server error occurred.Retry after some delay or contact support.

Errors are returned in the errors array in the GraphQL response. Always check for errors before processing data.

Performance Considerations

  • Use field selection to request only necessary fields to reduce response size and improve performance.
  • When querying products under manufacturer, use pagination to limit the number of returned products.
  • Avoid requesting deeply nested fields unless required.
  • The API enforces rate limiting; excessive requests may result in throttling.
  • Cache responses where possible, especially for manufacturer data that changes infrequently.

Authentication

This API currently does not require authentication. However, authentication requirements may be introduced in future versions. Monitor API updates for any changes to authentication requirements.

  • Manufacturer: The main return type for this query.
  • ProductConnection: Connection type for paginated products related to the manufacturer.
  • Filter: Filter objects available for the manufacturer.

Notes

  • The filters field may return null if no filters are set for the manufacturer.
  • The products field supports pagination; use edges and pageInfo to navigate large product lists.
  • The id argument is mandatory and must be a valid integer ID of an existing manufacturer.
  • Always handle possible null or missing fields gracefully in your client application.
Last updated on