Hashnode GraphQL API documentation for creating, managing, and querying blogs, posts, publications, and user data on the Hashnode platform
Comprehensive assistance with the Hashnode GraphQL API for blog management, content creation, and user interaction on the Hashnode platform.
This skill should be triggered when:
All Hashnode API requests go through a single GraphQL endpoint:
https://gql.hashnode.com (POST only)https://api.hashnode.com is discontinued - migrate to new endpointAuthorization header with your Personal Access Token (PAT)id field to avoid stale dataCommon GraphQL error codes:
GRAPHQL_VALIDATION_FAILED - Invalid query structureUNAUTHENTICATED - Missing or invalid auth tokenFORBIDDEN - Insufficient permissionsBAD_USER_INPUT - Invalid input dataNOT_FOUND - Resource doesn't existquery Publication {
publication(host: "blog.developerdao.com") {
id
isTeam
title
about {
markdown
}
}
}
Get basic information about a publication by its hostname.
query Publication {
publication(host: "blog.developerdao.com") {
id
isTeam
title
posts(first: 10) {
edges {
node {
id
title
brief
url
}
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
Retrieve the latest 10 posts from a publication with cursor-based pagination support.
query Publication {
publication(host: "blog.developerdao.com") {
id
post(slug: "the-developers-guide-to-chainlink-vrf-foundry-edition") {
id
title
content {
markdown
html
}
}
}
}
Get full content of a specific article using its slug and publication hostname.
query Publication {
publication(host: "blog.developerdao.com") {
id
posts(
first: 10
after: "NjQxZTc4NGY0M2NiMzc2YjAyNzNkMzU4XzIwMjMtMDMtMjVUMDQ6Mjc6NTkuNjQxWg=="
) {
edges {
node {
id
title
brief
url
}
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
Use endCursor from previous response as after parameter to fetch next page.
query Followers {
user(username: "SandroVolpicella") {
id
followers(pageSize: 10, page: 1) {
nodes {
id
username
}
pageInfo {
hasNextPage
hasPreviousPage
previousPage
nextPage
}
}
}
}
Navigate between pages using explicit page numbers.
query SeriesCount {
publication(host: "engineering.hashnode.com") {
id
seriesList(first: 0) {
totalDocuments
}
}
}
Result:
{
"data": {
"publication": {
"seriesList": {
"totalDocuments": 3
}
}
}
}
Use totalDocuments field to get counts without fetching all data.
query Publication {
publication(host: "lo-victoria.com") {
id
series(slug: "graphql") {
id
name
posts(first: 10) {
edges {
node {
id
title
}
}
}
}
}
}
Get all posts belonging to a specific series.
query Publication {
publication(host: "lo-victoria.com") {
id
staticPages(first: 10) {
edges {
node {
id
title
slug
}
}
}
}
}
Retrieve custom static pages like "About", "Contact", etc.
query Publication {
publication(host: "lo-victoria.com") {
id
staticPage(slug: "about") {
id
title
content {
markdown
}
}
}
}
Get content of a specific static page by slug.
query Publication($first: Int!, $host: String) {
publication(host: $host) {
id
drafts(first: $first) {
edges {
node {
id
title
}
}
}
}
}
Headers:
{
"Authorization": "your-personal-access-token-here"
}
Variables:
{
"first": 10,
"host": "your-blog-host.hashnode.dev"
}
Drafts can only be queried by the publication owner with valid authentication.
This skill includes comprehensive documentation in references/:
Use the reference files for detailed information about specific API features, error handling patterns, and advanced query techniques.
Start by understanding the core concepts above, then explore:
Focus on:
id fields to avoid stale dataExplore:
UNAUTHENTICATED errors, verify your PAT is in the Authorization headerextensions.code fieldapi.hashnode.com to gql.hashnode.comThe api.md reference file contains:
id field on objects to avoid stale cached datagql.hashnode.com onlyAuthorization header is set correctlyid field to avoid stale cached dataThis skill was automatically generated from official Hashnode documentation. To refresh with updated documentation, regenerate the skill using the latest docs from https://apidocs.hashnode.com.