DEV Community

AIGB Team
AIGB Team

Posted on

Onboarding Hashnode with GraphQL: A Step‑by‑Step Guide for Teams

Integrating a new publishing platform can feel like a mini‑project on its own: you need access tokens, you have to learn the API surface, and you must prepare the first batch of content that fits the new audience. This article walks through a real‑world onboarding flow for Hashnode, covering everything from token generation on a restricted IP to publishing the first three technical articles via GraphQL. The process is written for a small dev‑ops team that already uses Telegram for community management, so you’ll see concrete examples that you can copy‑paste into your own workflow.

1. Why Hashnode?

Hashnode is a developer‑centric blogging platform with built‑in SEO, community comments, and a GraphQL API that makes programmatic publishing painless. For teams that already produce content for Telegram groups or Discord, moving that knowledge base to Hashnode can:

  • Increase discoverability through Google’s index of developer blogs.
  • Provide a clean, markdown‑first editor that syncs with your existing docs.
  • Allow you to automate posting, updates, and cross‑posting via GraphQL mutations.

2. Prerequisites

Before you start, make sure you have the following:

  • The owner’s Hashnode account credentials (in our case [email protected]).
  • Access to the owner’s local machine. The API token must be generated there because Hashnode’s backend (running on Vercel) blocks requests from our SG‑based server IP.
  • A GraphQL client (e.g., curl, Postman, or a Node library like graphql-request).
  • The three draft articles saved as markdown files (draft1.md, draft2.md, draft3.md).

3. Generating the API Token on the Owner’s Machine

The token is a one‑time secret; it appears only once in the UI, so copy it immediately and send it via a secure channel (Telegram DM in our workflow).

  1. Open a browser on the owner’s computer and log in to hashnode.com with [email protected].
  2. Click the avatar in the top‑right corner → Settings.
  3. In the left navigation, choose Access Tokens.
  4. In the Generate API Token field, type a descriptive name such as aigb_prod_key_v1 and click Generate.
  5. Copy the token that appears, then paste it into a Telegram private message to the team lead.

Tip: The token is visible only once. If you lose it, you’ll have to regenerate a new one.

4. GraphQL Basics: Posting a Draft

Hashnode’s GraphQL endpoint is https://gql.hashnode.com/v2. Below is a minimal mutation that creates a draft post. Replace <TOKEN> and <MARKDOWN> with your actual values.

mutation CreatePost($title: String!, $content: String!, $tags: [String!]) {
  createPublicationStory(
    input: {
      title: $title
      content: $content
      tags: $tags
      isPublished: false   # false = draft, true = published
    }
  ) {
    code
    success
    message
    post {
      id
      slug
      publication {
        url
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

You can invoke it with curl like this:

curl -X POST https://gql.hashnode.com/v2 \
  -H "Authorization: Bearer <TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "mutation CreatePost($title: String!, $content: String!, $tags: [String!]) { createPublicationStory(input: {title: $title, content: $content, tags: $tags, isPublished: false}) { success code message post { id slug publication { url } } } }",
    "variables": {
      "title": "Automating Telegram Group Cleanup: A Practical Guide",
      "content": "<MARKDOWN>",
      "tags": ["Telegram", "Bots", "Automation"]
    }
  }'
Enter fullscreen mode Exit fullscreen mode

The response includes the newly created post’s ID and URL, which you can later poll with getPosts to confirm the publish status.

5. Preparing the First Three Articles

The goal is to launch with three pieces that showcase different angles of our community‑building product while avoiding duplicate topics we’ve already covered on Telegram. Below is a summary of each draft, the target audience, and the key call‑to‑action.

5.1. Article 1 – “Automating Telegram Group Cleanup: A Practical Guide”

  • Focus: How to replace manual spam removal with a bot.
  • Key Points:
    • Pain point: 50+ spam messages per day.
    • Solution: Deploy AI GroupButler (@groupbutleraibot) and enable the “Auto‑Mod” module on the web panel (gensi.space/upanel).
    • Highlight: Free forever AI‑driven semantic review that catches context‑aware violations.
  • CTA: “Add the bot to your dev group and start cleaning in 5 minutes.”

5.2. Article 2 – “Building Scalable Crypto Communities: Why Structure Matters”

  • Focus: Turning noisy Telegram crypto groups into structured knowledge hubs.
  • Key Points:
    • Current problem: “Shout‑and‑sell” channels lose information.
    • Feature deep‑dive: The web panel’s structured view that aggregates pinned messages, scheduled updates, and AI‑generated FAQs.
    • Comparison: Shows cost advantages over paid bots like Rose/Combot.
  • CTA: “Try the structured view today and keep your community’s data safe.”

5.3. Article 3 – “Zero‑Code Multi‑Language Customer Service for Telegram”

  • Focus: Building a multilingual support bot without writing code.
  • Key Points:
    • Barrier: Prompt engineering and context handling are complex.
    • Solution: The same AI GroupButler platform offers a one‑click memory mechanism and role‑switching (sales vs. companion).
    • Demo: A mock conversation with an Indonesian user using USDT/USDC for payouts (compliant, no “Stars”).
  • CTA: “Deploy your AI agent in under 3 minutes via the web panel.”

6. Publishing Schedule and Risk Management

Day Action Reason
T+0 Publish Article 1 (technical governance) Quick win; most developers relate to spam cleanup.
T+24 h Publish Article 2 (Web 3 community) Staggered release respects Hashnode’s initial rate limit of 1 request/min.
T+48 h Publish Article 3 (customer service) Demonstrates depth after the audience has warmed up.

6.1. Rate‑Limit Considerations

  • Initial limit: 1 request per minute for new accounts.
  • Mitigation: Insert a 60‑second sleep between GraphQL calls, especially when creating drafts and then publishing them.

6.2. Content Compliance

  • Use the phrase “free forever” instead of “free trial”.
  • Mention only stablecoins (USDT/USDC) when discussing payments; avoid any reference to “Stars”.
  • Keep product naming consistent (AI GroupButler or AIGB).

6.3. Monitoring

After each mutation, run a getPosts query to verify publishStatus transitions to PUBLISHED. Log the post IDs and URLs in a simple JSON file (publish_log.json) for future audits.

7. Wrapping Up

By following the steps above you can:

  1. Securely generate an API token on a restricted IP.
  2. Use a straightforward GraphQL mutation to create drafts.
  3. Deploy three high‑impact articles that introduce your community‑automation product to a developer audience.
  4. Respect Hashnode’s rate limits and compliance guidelines, reducing the risk of account throttling.

Once the first three posts are live, you’ll have a solid foundation to automate future releases—whether you’re pushing weekly updates, cross‑posting from your internal docs, or scaling community outreach across multiple languages.

Disclosure: drafted with AI assistance by the AIGB team and human-reviewed. AIGB is our product - bias disclosed.

Top comments (0)