Getting Null for Tags in GraphQL API
complete
Nitzan Ohana
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
}
}
}
Log In
Nitzan Ohana
thank you for your work! once I'll work on the plugin again I'll use the new API :)
Kavir
Nitzan Ohana: awesome! share the link once you're done
Sandro Volpicella
complete
Hi Nitzan Ohana
this is possible with our new API. The playground is available here: https://gql.hashnode.com
We also have a beta program in case you want to help us building some cool APIs :) https://townhall.hashnode.com/hashnode-public-apis-2-closed-beta
Here is an example query:
{
publication(host: "engineering.hashnode.com") {
posts(first: 2) {
edges {
node {
title
tags {
name
}
}
}
}
}
}
Kavir
in progress
Sandro Volpicella
Hi Nitzan Ohana
this is possible with our new API. The playground is available here: https://gql.hashnode.com
We also have a beta program in case you want to help us building some cool APIs :) https://townhall.hashnode.com/hashnode-public-apis-2-closed-beta
Here is an example query:
{
publication(host: "engineering.hashnode.com") {
posts(first: 2) {
edges {
node {
title
tags {
name
}
}
}
}
}
}
Kavir
planned
Kavir
Hi Nitzan Ohana we're working on improvements to our APIs and will provide an update on this soon!