twenty icon indicating copy to clipboard operation
twenty copied to clipboard

Forbid the creation of field named "and", "or" and "not"

Open lucasbordeau opened this issue 1 year ago • 6 comments
trafficstars

Scope & Context

In standard field features, and custom field creation.

Current behavior

We can currently input anything we want in a field name's singular or plural.

Expected behavior

In this case we want to forbid using pg_graphql's reserved operator for filtering. See https://supabase.github.io/pg_graphql/api/#filtering

Avoid naming your columns and, or or not. If you do, the corresponding filter operator will not be available for use.

Note that there could be other words we would want to forbid as well.

We would want to forbid this on the backend endpoint and also in the front end on field creation / update.

lucasbordeau avatar Dec 18 '23 17:12 lucasbordeau

@lucasbordeau can I be work on this.

mozesi avatar Dec 19 '23 14:12 mozesi

See also #2146 which is similar. Maybe we should just do 1 regex for both object name and field name

FelixMalfait avatar Jan 07 '24 19:01 FelixMalfait

@mozesi I'm sorry we didn't reply, if you're still interested let us know!

FelixMalfait avatar Jan 07 '24 19:01 FelixMalfait

@FelixMalfait am still interested.

mozesi avatar Jan 08 '24 17:01 mozesi

Great! Assigned you :). Thanks a lot!

FelixMalfait avatar Jan 08 '24 19:01 FelixMalfait

@mozesi any progress on this? Thanks!

FelixMalfait avatar Jan 25 '24 17:01 FelixMalfait

@FelixMalfait you could assign it to me. I can give it a shot

abusarah-tech avatar Feb 13 '24 22:02 abusarah-tech

Great thanks!

FelixMalfait avatar Feb 14 '24 14:02 FelixMalfait

@FelixMalfait We can close this issue I am assuming?

abusarah-tech avatar Feb 26 '24 20:02 abusarah-tech

Ah indeed thanks @AbuHafsa!

FelixMalfait avatar Feb 27 '24 07:02 FelixMalfait