-
-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditionally exclude fields from Query #470
Comments
As a rule we try to keep pg_graphql as configuration-free as possible For excluding entities from insert/update/delete the best solution is to revoke I could see an argument for a comment directive to exclude it from the Will leave this open and mark as good first issue |
Well, revoking access does disable operations at db low-level as well. One has no option to disable access via graphql layer only, nope? |
Being able to exclude tables from the schema is a logical feature, IMO. As @dvv mentioned, it isn't really feasible to restrict permissions on a table to the point where we can't interact with it. My current use case that ties into this is that I need to extend my schema in a way that pg_graphql does not currently support. To achieve this, I'm writing a small microservice with an edge function and stitching the endpoints together. It would be nice to exclude the relevant tables from the pg_graphql schema so that I can expose them through this microservice as a modular unit. I can, of course, handle type dupes and such in the stitching, but that creates more work than needed if I could simply decorate the table in Postgres to tell pg_graphql not to include it in the schema. |
In my case, I would like the user to be able to create entities and see the entity |
@FelixZY for an in both of those cases the API excludes those fields from each table's insert and update types so your value is always generated by postgres rather than being provided by the user I'll open an issue to add that info to the docs |
Please consider adding an
internal
(exclude
?) directive for any sort of fields. This should move the field out of Query/Mutation while keeping it available on deeper levels.The default to be the scope's value.
This is mainly to housekeep the Query/Mutation clean while having all needed things in one exposed db schema.
The text was updated successfully, but these errors were encountered: