graphile / graphile-engine

Monorepo home of graphile-build, graphile-build-pg, graphile-utils, postgraphile-core and graphql-parse-resolve-info. Build a high-performance easily-extensible GraphQL schema by combining plugins!
https://www.graphile.org/
761 stars 129 forks source link

[graphile-utils] `OrderSpec` type in `makeAddPgTableOrderByPlugin` is too restrictive #593

Closed keithlayne closed 1 year ago

keithlayne commented 4 years ago

OrderSpec is defined here.

The example from the docs doesn't match this type - it uses a function type in the first element of that tuple:

(context: GenContext) => SQLQuery

(Not sure that GenContext is actually right there)

TS error:

error TS2345: Argument of type '({}: GenContext) => SQLQuery' is not assignable to parameter of type 'string | SQLRawNode | SQLValueNode | SQLIdentifierNode | SQLQuery'.
  Type '({}: GenContext) => SQLQuery' is missing the following properties from type 'SQLQuery': pop, push, concat, join, and 27 more.
benjie commented 1 year ago

V5 overhauls all this, but I think it's fixed. Places to look: