hasura / graphql-engine

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
https://hasura.io
Apache License 2.0
31.12k stars 2.77k forks source link

Consumer view of graphql schema #3679

Open jonocodes opened 4 years ago

jonocodes commented 4 years ago

The console is a great place to show the full schema. It allows queries to be explored and designed by administrators.

I am using allowed_schemas to trim down our schema for a consumer. Ideally there would be a graphiql like UI for viewing the allowed_schemas only. This would be for consumers, so they have an easy way to discover what APIs are available to them.

Perhaps this UI could be shown when visiting the graphql root in the browser. http://localhost:8080/v1/graphql

webdeb commented 4 years ago

@jonocodes you can actually deploy graphiql where you want to https://github.com/graphql/graphiql/tree/master/packages/graphiql

By deploying it yourself, you also get the full control over the UI, so you can provide your own specific features etc.

jonocodes commented 4 years ago

Yes, thats what I'm basically doing in development for now. I have a local HTML file with graphiql pointing at my Hasura API.

But it seems to me this would be a valuable feature for other users as well. For most graphql APIs I have used as a consumer there is an endpoint that has some auto-generated docs/discoverability weather its swagger or graphiql.

webdeb commented 4 years ago

@jonocodes its just too simple to add it yourself, and if it would go into hasura core, it would mean additional headache for the small hasura team. Because maybe you are OK with this feature to be public, others will create a bunch of issues because they want that and that feature, and permission rules etc. you know what I mean. And it does not add any core functionality improvements, just overhead.

webdeb commented 4 years ago

Think about styling, users will definitely claim about this (because they want the appearance to of their CI), and then finally they will rollout it themself in 5 minutes