BrandonCookeDev / smashgg.js

Node.JS SDK for the Smash.gg public API.
https://www.npmjs.com/package/smashgg.js
34 stars 13 forks source link

No documentation for Tournaments by Videogame? #52

Open midblue opened 4 years ago

midblue commented 4 years ago

(Question, not issue!)

There's a page on the smash.gg developer docs that outlines a Tournaments by Videogame endpoint. I don't see that anywhere on smashgg.js's docs; is that an intentional omission? Or is there something available to get that data?

Thanks! :)

BrandonCookeDev commented 4 years ago

So not every example on their site has a 1-to-1 implementation in the SDK; this is mostly because the use cases vary in size from situation to situation.

Since this is an SDK, I intended for it to help developers tackle the small units of work that would come with using their API (ie pulling a tournament then searching the sets for some data are two calls instead of one more complex function). The more broad a use case, the more of a reason I see it belonging in the SDK. If it's specific, then there's less of a reason since it affects a far smaller amount of developers.

However that being said, I've done literally nothing on this project for months, and honestly I wouldn't have too much issue adding this in to help you out.

midblue commented 4 years ago

Hi! Wow, that was a fast reply. First off I just want to say thanks for making such a solid SDK and for being so active in the issues even though you're not developing for it directly at the moment! Please let me know if you're really going to follow through on that offer to add it in, or if I should start trying to figure out my own hacked-together queries that would fall outside of the rate limiting etc offered by your SDK.

BrandonCookeDev commented 4 years ago

That's a good point I wasn't considering.. My backend setup to handle their rate limit is quite convenient, and it's probably hard to setup projects mincing my sdk with raw queries.

I believe that the functions in the NetworkInterface.js actually allow for a query to be entered by a developer for use in the queuing backend; however there could be an easier way to access this so I'll consider adding a convenience function to the root of the SDK.

For now I'll plan on adding your function in soon. I'll keep this open until it's done.

midblue commented 4 years ago

That's extremely smart! I would actually say that letting users add their own queries into the queue (with well-documented formatting for how to make those queries) is actually a much better capability than what I asked for, and would allow for anyone who needs one of these edge cases — like me — to make it happen within your already excellent framework without any additional work from you to add a helper function. (Emphasis on well-documented! Because to be honest, not knowing how to make a graphql query properly via a POST request is what brought me to your library in the first place.)

BrandonCookeDev commented 4 years ago

So I forgot to update on this. It's taken a while to get the above implemented due to my daily life. I will jump back into this with the other bugs I need to look at.