On my search I found this question asked here, and especially this answer.
The answer I found in quote:
This functionality is implemented in graphile-build-pg via the
pgStrictFunctions setting, but this isn't currently exposed via
postgraphile-core to PostGraphQL itself. What it does is treats all
functions as strict, requiring all arguments to be marked as required
unless they have defaults.
It is possible to mark an argument as default null, but of course a
strict function with a null default will automatically return null
without being called.
create function a(b int, c int default null)
returns int as $$
select b;
$$ language sql stable;
By default neither b nor c will be required, but with
pgStrictFunctions set b will be marked as required (but c will not).
While it mentions a solution it does not state how to implement it. Searching the entire project (including node_modules) for 'pgStrictFunctions' did not give any clues either. How to implement I finally found on discord, this is how I finally got it working:
@Module({
controllers: [],
imports: [
PostGraphileModule.forRoot({
......
graphileBuildOptions: {
pgStrictFunctions: true,
},
......
}),
],
providers: [GraphQLService],
})