Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Query Non-Featured Posts #254

Open
iwootten opened this issue Feb 2, 2022 · 0 comments
Open

Unable to Query Non-Featured Posts #254

iwootten opened this issue Feb 2, 2022 · 0 comments

Comments

@iwootten
Copy link

iwootten commented Feb 2, 2022

I'm unable to query the API for non-featured posts.

I can see the v2 docs state the posts object has a "featured" flag which:

  • "Select Posts that have been featured or not featured depending on given value."

I can see this issue has come up before in #140 for v1 of the API, but it appears as a query param on v2?

If I use it to make the following query, I only get featured posts returned.

Query

  posts(featured: false) {
    edges {
      	cursor
        node {
            id
            name
            featuredAt
            votesCount
            url
            website
        }
    }
  }
}

Response

{
  "data": {
    "posts": {
      "edges": [
        {
          "cursor": "MQ==",
          "node": {
            "id": "328701",
            "name": "ThreadStart",
            "featuredAt": "2022-02-02T08:01:00Z",
            "votesCount": 228,
            "url": "https://www.producthunt.com/posts/threadstart?utm_campaign=producthunt-api&utm_medium=api-v2&utm_source=Application%3A+PH+API+Explorer+%28ID%3A+9162%29",
            "website": "https://www.producthunt.com/r/83aacb8c60db4d?utm_campaign=producthunt-api&utm_medium=api-v2&utm_source=Application%3A+PH+API+Explorer+%28ID%3A+9162%29"
          }
        },
                {
          "cursor": "Mg==",
          "node": {
            "id": "329840",
            "name": "Beseda Share",
            "featuredAt": "2022-02-02T08:02:52Z",
            "votesCount": 193,
            "url": "https://www.producthunt.com/posts/beseda-share?utm_campaign=producthunt-api&utm_medium=api-v2&utm_source=Application%3A+PH+API+Explorer+%28ID%3A+9162%29",
            "website": "https://www.producthunt.com/r/5c6b34faad158b?utm_campaign=producthunt-api&utm_medium=api-v2&utm_source=Application%3A+PH+API+Explorer+%28ID%3A+9162%29"
          }
        },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant