datopian / data-api

Next generation Data API for data management systems including CKAN.
https://tech.datopian.com/data-api/
MIT License
9 stars 3 forks source link

(Maybe) GraphQL playground as dynamic docs #23

Open EvgeniiaVak opened 3 years ago

EvgeniiaVak commented 3 years ago

When studying GraphQL with node-js I was able to explore the underlying graphql schema with the interactive documentation via GraphQL playground (based on GraphQL schema, all items are clickable there):

image

Hasura also has something like this via their console app, maybe it'd be possible to expose that as the API documentation: https://hasura.io/learn/graphql/hasura/data-modelling/4-try-todos-queries/ graphql-query-todo

So maybe to autogenerate API docs we could wire up one of those?

EvgeniiaVak commented 3 years ago

cc @leomrocha @rufuspollock @anuveyatsu ^

rufuspollock commented 3 years ago

@EvgeniiaVak i think this is a great idea - are you suggesting we enable this by default on the base API page or somewhere else?

EvgeniiaVak commented 3 years ago

I don't really know, somewhere, the nodejs wrapper has datastore_search endpoint also which is not graphql, so it wouldn't be right to put only graphql docs in the base API page, maybe on the base API page we could have links to two docs - one for the REST endpoint, the other - to graphql

leomrocha commented 3 years ago

I really like this, I would make it as a separate service or plugin that can be deployed with the data-api.

I don't really know, somewhere, the nodejs wrapper has datastore_search endpoint also which is not graphql, so it wouldn't be right to put only graphql docs in the base API page, maybe on the base API page we could have links to two docs - one for the REST endpoint, the other - to graphql

Concerning the documentation, I also think that separating it in maybe two files REST.md and GRAPHQL.md would be a nice thing.

rufuspollock commented 3 years ago

@leomrocha / @EvgeniiaVak can you add tasks and acceptance items to the task to summarize what work would be needed.