Policy
A store policy with its type, title, content, and URL.
Type Definition
type Policy {
type: String!
title: String!
body: String!
url: String!
}Fields
| Field | Type | Description | Nullable | Relationship |
|---|---|---|---|---|
| type | String! | The type of the policy (e.g., terms_and_conditions, privacy_policy). | No | None |
| title | String! | The localized title of the policy. | No | None |
| body | String! | The HTML content of the policy. | No | None |
| url | String! | The URL where the policy can be viewed. | No | None |
Relationships
The Policy object type is used within the StorePolicies object, specifically in the following fields:
StorePolicies.termsAndConditionsStorePolicies.privacyPolicyStorePolicies.shippingPolicyStorePolicies.refundPolicy
These relationships indicate that a Policy instance represents a specific policy document associated with the store, accessible via these fields.
Usage Examples
Basic Query
{
storePolicies {
termsAndConditions {
type
title
body
url
}
}
}Field Selection
{
storePolicies {
privacyPolicy {
title
url
}
refundPolicy {
type
body
}
}
}Nested Queries
{
storePolicies {
shippingPolicy {
type
title
body
url
}
}
}Filtering and Sorting
The Policy type does not support filtering, sorting, or pagination directly as it represents a single policy object. Filtering and sorting would need to be applied at the parent query level if applicable.
Implements
The Policy type does not implement any interfaces.
Connections
There are no connection fields defined on the Policy type.
Related Types
StorePolicies: The parent object that exposes various policies asPolicyobjects.
Best Practices
- Always select only the fields you need (
type,title,body,url) to optimize query performance. - Use the
urlfield when you want to provide users with a direct link to view the policy in a browser. - The
bodyfield contains HTML content; ensure your client safely renders or sanitizes this content to prevent XSS vulnerabilities. - Since policies rarely change frequently, consider caching responses where appropriate to reduce load times.
Notes
- All fields on the
Policytype are non-nullable and guaranteed to be present. - The API currently requires no authentication to query policies, but this may change in future versions.
- The
bodyfield contains the full HTML content of the policy, which can be large; request only when necessary. - There are no computed or derived fields on this type.
- No field arguments are defined for the
Policytype.
Last updated on