graphile / graphile.github.io

PostGraphile (PostGraphQL) and Graphile-Build website - contributions very welcome!
https://www.graphile.org/
25 stars 128 forks source link

Move "simple subscriptions" to be first example #330

Closed cellis closed 2 years ago

cellis commented 2 years ago

Custom Subscriptions require writing out (in literals) actual graphql schema types, which seems to be contra to the spirit of Postgraphile ( "write your application logic in either plpgsql or (Type|Java)script and postgraphile handles the rest!" ). It's therefore a slightly better developer experience to surface Simple Subscriptions earlier in the documentation than the more advanced Custom Subscriptions.

benjie commented 2 years ago

PostGraphile encourages solid schema design with discoverability via the docs and strong typing; simple subscriptions are the antithesis of this with having to enter specific strings that aren’t listed anywhere to make it work, and having to know what type is going to be returned in order to build a useful query. I strongly discourage their use. In future I will likely introducing a naming convention for triggers and reflect that into the schema, but for now you really are better off writing the subscriptions you need straight into the schema rather than using “simple” subscriptions.

cellis commented 2 years ago

@benjie makes complete sense now! Thanks for taking time to review and hope you're well friend!