olirice / nebulo

Instant GraphQL API for PostgreSQL and SQLAlchemy
MIT License
92 stars 5 forks source link

excluding columns from graphql models #4

Closed olirice closed 4 years ago

olirice commented 4 years ago

Need method for excluding fields that we never want to see directly, e.g. password_hash

and excluding server generated fields from being definable by the user.

For example, a user should not be able to define the value of a serial id in a create mutation

olirice commented 4 years ago

e22de89017210078737e0d2f366ba7139d486ba6 adds support for excluding columns from the graphql schema via sql comments

For example, the following remove username as an allowed field in updates (UserAccountPatch)

comment on column user_account.username is E'@exclude update';

allowed options are insert update read and delete

multiple options can be specified in a single exclude e.g. @exclude update,delete

Documentation is required before issue can close