fix(rbac): Custom mutations fallback to FooBaseInput when FooInput isn't available #375
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #373
If
insert(some_column)
is not granted onfoo
thenFooInput
would have no fields, and thus is not generated.In this case, a volatile function that accepts a
foo
parameter will not have a type for said parameter, and so will not add the function to the schema.The current workaround for this is to use the smart comment in the error message:
COMMENT ON FUNCTION my_func(foo) IS E'@arg0variant base';
This tells PostGraphile to use the "base" input type (like a "super-patch" that contains all columns as nullable).
This patch makes the system fall back to the base input type automatically if no normal input type is available.