@dhruvparmar Hey, I've got a quick question regarding the API - So a simple body param to fetch posts would look like "query": "query { posts(first: 1) { edges { node { id, name } } } }", but what would one for fetching something more nested like the posts in a collection look like? And in general where can I find this documented?
EDIT: I've now figured it out. For anyone curious: Start with "collection(id: idOfTheCollection) {... which should return all posts in the collection.
@dhruvparmar Is there a way to upvote using this API? I don't see a mutation for that? Also, what will be the validity for the access_grant_token & access_token?
@dhruvparmar Seems like doing a "goals" query keeps returning a 204 (no content) for me. It works fine from the API explorer, but any call to this endpoint from my code succeeds but doesn't return anything. Any idea on what may be up with this?
EDIT: This has now been resolved on the server-side.
@dhruvparmar Hi, I've got a quick question about mutations. When attempting to mark a goal as complete, I only get returned {"data":{"goalMarkAsComplete":{"node":null}}}
Is this intentional? As it doesn't actually seem to perform the action. Here is my request:
mutation {
goalMarkAsComplete(input: {clientMutationId: "\(clientId)", goalId: \(goalId)}) {
node {
id, completedAt, createdAt, title, user {
name, id, profileImage, username
}
}
}
}
And what is the clientMutationId? Is it just a random String or the client ID that's retrieved when authenticating?
EDIT: After looking at the error, it's an access_denied error, any way to resolve this?
@dhruvparmar I see some planned updates to APIs here and see recent changes on github. Will the docs be updated asap or do we need to keep an eye here and on github?
@wayfarerish hey, any updates to the GraphQL interface of the API will always reflect in the reference here http://api-v2-docs.producthunt.c...
Unfortunately we don't have a change-log yet so we've decided to publish those updates here as well for the Makers festival participants.
@dhruvparmar Thanks. I'll figure something out. I see that the order of media in the API is different than that on the website. is that bug or website uses some type of sorting?
@dhruvparmar hi, still pretty new on this graphql things, but it seem like no way to filter the records ? like if I want to filter all my goals that complete only ? I can only fetch all and filter locally ?
@imknight hey, you can filter "goals" by using "completed" flag here http://api-v2-docs.producthunt.c...
Setting `completed: true` on the query will result in only completed goals being fetched.
@dhruvparmar Hello, how can I get all user following and do not rest against the limit of the API?
For example, I want to see what people which I follow do on PH(upvote something, comment, add/finish goal)
@nikolay_siabrenko you can look up "followers" for a user. check here http://api-v2-docs.producthunt.c...
If you run into rate limit issues try fetching "followers" on a per "user" basis. http://api-v2-docs.producthunt.c...
We do not support subscriptions as of now, so to get a "user"'s activity you would have to regularly poll for the specific data and detect changes in that on your end. For e.g
1. To detect if a user upvoted a new post, you could poll for "votedPosts" list on the "user" object.
2. To detect changes to user's goal, you can poll "goals(userId: idOfUser)" connection with 'NEWEST' filter.
@amitchambial hey, we've just released some fixes to the API. could you retry the same mutation?
Incase the issue still persists, please write to us at hello@producthunt.com with your API Key & the input you are using for the mutation.
Replies
Bulletin
YourStack
Bulletin
YourStack
NewsletterStash
Ahey
YourStack
YourStack
Bulletin
Bulletin
Bulletin
YourStack
Bulletin
Makerbox for Product Hunt
YourStack
Makerbox for Product Hunt
NewsletterStash
YourStack
NewsletterStash
Scout
YourStack
Scout
Upvote Bell
YourStack
Upvote Bell
YourStack
Goals 2.0
YourStack