Skip to content

RC5: improved errors, PG10 identity column support

Compare
Choose a tag to compare
@benjie benjie released this 13 Sep 14:56

The biggest issue people tend to face when getting started with PostGraphile are name collisions - where something in your database causes the same name for a type or a field to be generated twice in the GraphQL schema PostGraphile generates, leading to a failure to start. Errors generated previously were pretty obtuse, we now output much more information when this happens, including what the source of the two conflicting names were, and even hinting how it might be possible to fix it using smart comments:

Error: A naming conflict has occurred - two entities have tried to define the same key 'query'.

  The first entity was:

    Default field included in newWithHooks call for 'Query'. graphile-build built-in (root query type)

  The second entity was:

    Adding row by globally unique identifier field for table "public"."query". You can rename this table via:

      COMMENT ON TABLE "public"."query" IS E'@name newNameHere';

These errors can clearly be enhanced further - if this is something that interests you please get in touch!

We've also squashed a few remaining bugs, and even added a new introspection template system so we can more easily support different PostgreSQL versions (thanks @mattbretl!).

Improvements:

  • Massively improved name collision errors (graphile/graphile-engine#292)
  • PG10 identity column support (and preliminary PG11 support) thanks to @mattbretl (graphile/graphile-engine#294)
  • Multi-column relations (foreign key (col_a, col_b) references other_table(col_1, col_2)) where the column spec ((col_a, col_b)) has a unique constraint now result in a one-to-one reference instead of a connection. (The connection still exists, but it's deprecated, so this is not a breaking change.) (graphile/graphile-engine#298)
  • Added --skip-plugins option to the CLI, and documented it in the middleware thanks to @mattbretl (#853)

Fixes:

  • When paginating backwards using a before cursor combined with last option over a connection without a unique ordering constraint (such as a function, or a table with no primary key) the hasNextPage entry in pageInfo would incorrectly return false; this is now fixed. (graphile/graphile-engine#297)
  • Fixes an issue that can lead to memory exhaustion
  • Passing -A '' to postgraphile now allows you to disable JWT audience validation (as the documentation claims). (#848)

🙏 Sponsor PostGraphile Development 🙏