v4.5.0 - Explain and Smart Tags
Lots of pull requests and documentation improvements from the community in this release! 🙌
First, things to be aware of before you deploy:
- previously the CLI would ignore arguments it didn't understand (dangerous!) now it exits stating the arguments it wasn't expecting
- more improvements have been made to our TypeScript types, and there's more to come, so your builds might need some minor type tweaks
New feature spotlight: explain
In enhanced GraphiQL you can now toggle 'Explain' to view the generated SQL and the query plan of that statement. This is not enabled by default - you have to opt in with --allow-explain
, or in library mode you can supply an allowExplain(req)
function that determines on a per-request basis if the user may use the explain functionality or not.
New feature spotlight: Smart Tags
No longer do you need to put COMMENT
commands in the database ("smart comments") to customise your schema, you can now use a tags file to gather these "smart tags" into one, version controlled, easy to diff, place. Smart comments and smart tags can be used in unison, and both will be supported going forward so you can pick whichever works best for your team. In library mode you can manage smart tags however you like, and it's possible to pull smart tags from multiple sources and they will be automatically combined. Find out more about smart tags here: graphile.org/postgraphile/smart-tags/.
Community member @singingwolfboy has drafted a JSON schema definition that may help editors such as VSCode to help you when editing the default postgraphile.tags.json5
file. We've not upstreamed it yet, but hopefully will do so in the coming months.
New video
Team Graphile went to ReactiveConf in Prague last month; check out Benjie's talk Increasing Velocity with GraphQL and PostgreSQL.
🙏 HUGE THANKS TO NEW, EXISTING AND PREVIOUS SPONSORS! 🙏
We now have 84 sponsors across GitHub and Patreon and that means we're funded to spend an average of nearly 2 days per week on Open Source; this is brilliant!
Don't forget GitHub are matching sponsorship currently - so do sign up to be a sponsor if you haven't already - the more time we can put into open source, the faster we can build awesome tools for you to build epic software with!
Changes
Features
- graphiql: add 'explain' button (#1179) (1a065ab)
- jwt: support lazy public key loading for verification (#1167) (d27aaf9); thanks @ab-pm
- tags: add
postgraphile.tags.json5
support (#1177) (7da3c7f), closes graphile/graphile-engine#529 - jwt: add asymmetric JWT signing and verifying support (#1089) (b4730b7); thanks @speller
- graphiql: save headers to localStorage (#1174) (37abcd3); thanks @phryneas
- connections: expose totalCount on custom connections (#529) (b6c08cf); thanks @mattbretl
- pg: add partial index detection to introspection (#535) (360e5e0); thanks @hansololai
- pg: add support for cidr and macaddr types (#520) (676c3f2) - opt in with
pgUseCustomNetworkScalars
; thanks @higherorderfunctor - QueryBuilder: new methods for managing QB children (#537) (1a8a0bc); thanks @singingwolfboy
- utils:
@pgQuery
support for scalars (#534) (49259c2); thanks @phryneas/Mayflower - utils:
@pgQuery.source
can be function (#555) (907c8e6) - utils: add makePgSmartTagsPlugin (#541) (40a7bfa)
- utils: makeExtendSchemaPlugin supports enums and default values (#562) (2a23aee)
- types: various improvements to the TypeScript typings, including making
Middleware
generic - export: only write schema if it differs (#1180) (6334897)
Bug Fixes
- cli: abort if given unused arguments (#1181) (3e7381d)
- jwt: allow JWT exp to be bigint (#542) (69c7e8e)
- omit: if you omit update on all columns don't throw (#531) (b5d9e99)
- pagination: fix bug in cursor pagination for PL/pgSQL SETOF… (#559) (0089a07)
- types: correct tuples to arrays in pgIntrospectionPlugin (#530) (6488d5c); thanks @hansololai
- types: export more types inc PgIntrospectionResultByKind (#532) (1689f66); thanks @hansololai
- types: minor TypeScript fixes (#545) (0170064); thanks @benhjames
- types: use jwt.Secret type in PostGraphileCoreOptions (#546) (be18000); thanks @ab-pm
- watch: don't built schema twice in watch mode (#558) (0a36f7b)
- graphiql: fix operation detection on multi-op documents (#1191) (49b2176)
- utils: make makeAddPgTableConditionPlugin work on simple collections (#569) (0a4db65)
We're no-longer listing chore-level items, but there have been a lot of them. Special thanks to @singingwolfboy for helping me to keep the codebase tidy.