PostGraphile docs: ambiguous example in makeExtendSchemaPlugin docs
Summary
https://postgraphile.org/postgraphile/next/make-extend-schema-plugin#example-2 needs fixing, add some warnings around it for context
Additional context
One of our sponsors has asked if there's a potential N+1 problem within this example, which Benjie has described as "terrible".
withPgClientby default is designed for use in mutations. It runs the query once for each entry in the batch. At the root level (as here) there is noN(we're at root) so this is fine; but if you were to add that to a non-root type (e.g.UserorPostor whatever) then yes absolutely it would destroy performance. FurtherwithPgClientis flagged as a mutation (hasSideEffects = true) and that will impact the efficiency of your plans too.
Related: #2044