psychonautwiki / bifrost

The PsychonautWiki API.
MIT License
48 stars 10 forks source link

Basic schema text documentation #1

Closed estiens closed 5 years ago

estiens commented 7 years ago

Hi there,

I'm developing a harm reduction chatbot that is going to rely on pulling information from the psychnonaut wiki API. It would be super helpful to have a text document that lists the entire schema that could be returned -- something like

insufflated_afterglow_time_units, string, example value: 'minutes'
insufflated_comeup_time_units, string, example_value: 'minutes'
insufflated_dose_units, string, example_value: 'mg'
insufflated_heavy_dose, integer, example_value: 10

etc etc etc

Also, an endpoint that could return all substances that one can currently get information about.

Let me know if there's any way I could help with this, thanks!

19h commented 7 years ago

You can find more information regarding the schema here: https://github.com/psychonautwiki/bifrost/blob/master/server/graph/schema/rootQuery.js#L7-L196.

Additionally, you can use introspection queries agains the GraphQL endpoint; alas this isn't exactly intuitive and needs to be simplified.

estiens commented 7 years ago

Great, thanks!

IridiscentBlue commented 6 years ago

A suggestion would be to make use of Swagger (https://swagger.io/) for the API generation to allow an easier dynamically generated wrapper layer for common scripting languages etc

This likely isn't going to be a simple path to go down but would be longer term more sustainable and maintainable for adding additional integration's in future

19h commented 5 years ago

Swagger won't happen. GraphQL is not a REST-API. Please try to get used to the GraphQL schemata provided as documentation in the API UI or - as previously mentioned - to the schema itself: https://github.com/psychonautwiki/bifrost/blob/master/server/graph/schema/rootQuery.js#L57-L223.