store
Get basic store information including domain, logo, favicon, and policies.
Query Structure
query {
store {
domain
logo
favicon
name
customerAccountsEnabled
customerAccountsOptional
customerAccountsRequireApproval
catalogBrowsingRequiresAccount
canSellOverStock
isPasswordProtected
defaultConsentOptions
}
}
Arguments
This query does not accept any arguments.
Argument | Type | Description | Required | Default Value |
---|---|---|---|---|
— | — | — | — | — |
Return Type
Type: StoreInfo
Basic information about the store including domain, logo, policies, and account settings.
Field | Type | Description | Required |
---|---|---|---|
domain | String | The domain of the store. | Yes |
logo | String | The store’s logo if it is set. | No |
favicon | String | The store’s favicon if it is set. | No |
name | String | The name of the store. | Yes |
customerAccountsEnabled | Boolean | Returns true if customer accounts are enabled in the store. | Yes |
customerAccountsOptional | Boolean | Returns true if customer accounts are optional. | Yes |
customerAccountsRequireApproval | Boolean | Returns true if customer accounts need to be approved. | Yes |
catalogBrowsingRequiresAccount | Boolean | Returns true if a customer account is required to browse the catalog. | Yes |
canSellOverStock | Boolean | Returns true if the store can sell over stock. | Yes |
isPasswordProtected | Boolean | Returns true if the store has password protection enabled. | Yes |
defaultConsentOptions | [String] | Returns the default consent options for the store that a user can accept. | Yes |
Examples
Basic Query
query {
store {
domain
name
customerAccountsEnabled
}
}
Advanced Query
query {
store {
domain
logo
favicon
name
customerAccountsEnabled
customerAccountsOptional
customerAccountsRequireApproval
catalogBrowsingRequiresAccount
canSellOverStock
isPasswordProtected
defaultConsentOptions
}
}
Field Selection
query {
store {
name
domain
isPasswordProtected
defaultConsentOptions
}
}
cURL Example
curl -X POST https://www.mystoreurl.com/graphql/0.8.0/ \
-H "Content-Type: application/json" \
-d '{"query":"query { store { domain name customerAccountsEnabled } }"}'
JavaScript Example
async function fetchStoreInfo() {
const endpoint = "https://www.mystoreurl.com/graphql/0.8.0/";
const query = `
query {
store {
domain
name
customerAccountsEnabled
}
}
`;
try {
const response = await fetch(endpoint, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({ query })
});
if (!response.ok) {
throw new Error(`Network error: ${response.status} ${response.statusText}`);
}
const { data, errors } = await response.json();
if (errors) {
console.error("GraphQL errors:", errors);
return;
}
console.log("Store Info:", data.store);
} catch (error) {
console.error("Fetch error:", error);
}
}
fetchStoreInfo();
Response Format
{
"data": {
"store": {
"domain": "example.com",
"logo": "https://example.com/logo.png",
"favicon": "https://example.com/favicon.ico",
"name": "Example Store",
"customerAccountsEnabled": true,
"customerAccountsOptional": false,
"customerAccountsRequireApproval": false,
"catalogBrowsingRequiresAccount": false,
"canSellOverStock": true,
"isPasswordProtected": false,
"defaultConsentOptions": ["email_marketing", "sms_notifications"]
}
}
}
Error Handling
Error Code | Description | Resolution |
---|---|---|
400 Bad Request | The query is malformed or invalid. | Check the GraphQL query syntax and structure. |
500 Internal Server Error | Server encountered an unexpected condition. | Retry the request after some time or contact support. |
GraphQL Errors | Errors returned in the errors field of the response. | Inspect the error messages for details and adjust the query accordingly. |
Performance Considerations
- The
store
query returns a small, fixed set of fields and is optimized for quick retrieval. - Avoid requesting unnecessary optional fields (
logo
,favicon
) if not needed to reduce payload size. - This query does not support pagination or filtering as it returns a single store object.
- Rate limiting may apply to the API; implement exponential backoff or retries on HTTP 429 responses.
- Cache the response where appropriate, as store information 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.
Related Types
StoreInfo
Field | Type | Description |
---|---|---|
domain | String | The domain of the store. |
logo | String | The store’s logo if it is set. |
favicon | String | The store’s favicon if it is set. |
name | String | The name of the store. |
customerAccountsEnabled | Boolean | Returns true if customer accounts are enabled in the store. |
customerAccountsOptional | Boolean | Returns true if customer accounts are optional. |
customerAccountsRequireApproval | Boolean | Returns true if customer accounts need to be approved. |
catalogBrowsingRequiresAccount | Boolean | Returns true if a customer account is required to browse the catalog. |
canSellOverStock | Boolean | Returns true if the store can sell over stock. |
isPasswordProtected | Boolean | Returns true if the store has password protection enabled. |
defaultConsentOptions | [String] | Returns the default consent options for the store that a user can accept. |
Notes
- The
store
query provides essential information useful for storefront display, customer account management, and policy enforcement. - The
defaultConsentOptions
field lists consent types (e.g., marketing preferences) that the store supports by default. - Optional fields such as
logo
andfavicon
may be null if not configured. - The boolean fields related to customer accounts and catalog browsing help tailor user experience and access control.
- Always check for the presence of optional fields before usage to avoid runtime errors.
Last updated on