My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Getting Null for Tags in GraphQL API

Nitzan Ohana's photo
Nitzan Ohana
·Jan 8, 2021·

1 min read

Hello, I'm the createor of gatsby-source-hashnode, Gatsby plugin to integate hashnode with gatsby. Recently I'm trying to add tags support to the plugin.

While trying to query tags with this GraphQL query (api.hashnode.com):

{
  user(username: "USERNAME") {
    publication {
      posts {
        _id
        cuid
        tags {
          name
        }
      }
    }
  }
}

I receive null in all the tags:

{
  "data": {
    "user": {
      "publication": {
        "posts": [
          {
            "_id": "12324",
            "cuid": "123333",
            "tags": [
              {
                "name": null
              },
              {
                "name": null
              },
              {
                "name": null
              },
              {
                "name": null
              }
            ]
          },

Tried even adding my developer key but only null returns.

Querying the direct post with this query however works:

{
  post(slug: "3234", hostname: "asdasd") {
    tags {
      name
    }
  }
}