Blog
Represents a blog object, including its articles and related information.
Type Definition
type Blog {
articles: [Article]
recent: [Article]!
lastUpdated: [Article]
}Fields
| Field | Type | Nullability | Description | Relationship |
|---|---|---|---|---|
| articles | [Article] | Optional | List of all articles published in this blog. | Related to Article type |
| recent | [Article] | Non-null | List of recently published articles in this blog. | Related to Article type |
| lastUpdated | [Article] | Optional | List of recently updated articles in this blog. | Related to Article type |
Relationships
- articles: Connects the
Blogto multipleArticleobjects representing all articles published under this blog. - recent: Connects the
Blogto multipleArticleobjects representing the most recently published articles. This field is always present (non-null). - lastUpdated: Connects the
Blogto multipleArticleobjects representing articles that have been recently updated.
These relationships allow traversal from a blog to its articles, enabling retrieval of different subsets of articles based on publication or update recency.
Usage Examples
Basic Query
Fetch all recent articles in a blog:
{
blog(id: 101) {
recent {
id
title
publishedAt
}
}
}Field Selection
Retrieve all articles and recently updated articles with their titles and IDs:
{
blog(id: 101) {
articles {
id
title
}
lastUpdated {
id
title
}
}
}Nested Queries
Fetch recent articles with nested blog information for each article:
{
blog(id: 101) {
recent {
id
title
blog {
id
articles {
id
title
}
}
}
}
}Filtering and Sorting
The Blog type itself does not expose filtering, sorting, or pagination arguments on its fields directly. To filter or sort articles, use queries on the Article type with appropriate arguments (not shown here as outside the scope of the Blog type fields).
Implements
The Blog type does not implement any interfaces.
Connections
The Blog type connects to the Article type via the fields:
articlesrecentlastUpdated
These connections provide access to lists of articles related to the blog.
Related Types
- Article: Represents individual articles associated with the blog. The
articles,recent, andlastUpdatedfields return lists of this type.
Best Practices
- Use the
recentfield to efficiently fetch the latest published articles, as it is guaranteed to be non-null. - When displaying a blog’s content overview, consider combining
articlesandlastUpdatedto show both all articles and recently updated content. - For performance, avoid querying large lists in
articleswithout pagination (handled at theArticletype level). - Use nested queries to traverse from articles back to their blog if contextual information is needed.
Notes
- The API currently requires no authentication, but this may change in future versions.
- The
articlesandlastUpdatedfields are optional and may returnnullif no articles exist or updates are available. - No computed or derived fields are defined on the
Blogtype. - No field arguments are defined on the
Blogfields. - To optimize performance, limit the number of articles requested in queries or use filtering and pagination on the
Articletype where supported.