graphile / crystal

🔮 Graphile's Crystal Monorepo; home to Grafast, PostGraphile, pg-introspection, pg-sql2 and much more!
https://graphile.org/
Other
12.62k stars 571 forks source link

Fix bug determining required args of `returns table` functions #2230

Closed benjie closed 2 weeks ago

benjie commented 2 weeks ago

Description

Fixes #2216

returns table and out arguments count as arguments but not as input arguments (except inout args which count as both). Previously we calculated the number of required arguments as numberOfArguments - numberOfArgumentsWithDefaults; but this calculation should instead have been numberOfInputArguments - numberOfArgumentsWithDefaults - i.e. it only applies to input arguments. This is now resolved.

The result is that fewer arguments are now seen as required, making this a non-breaking change (though it may result in some arguments losing their non-null status, that is safe for existing queries).

Performance impact

Negligible.

Security impact

Doubtful.

Checklist

changeset-bot[bot] commented 2 weeks ago

🦋 Changeset detected

Latest commit: 809c7eedbaedb66ec4194fd456970a9d44ff11bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages | Name | Type | | ----------------- | ----- | | graphile-build-pg | Patch | | postgraphile | Patch | | graphile-utils | Patch | | pgl | Patch | | graphile | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR