Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Allow "null" to be passed in filters #142
Comments
|
Did some initial work here: https://github.com/richmolj/graphiti/tree/filter_nil Though the work is pretty straightforward, there is a purpose to disallowing nils. Passing a nil can sometimes cause slow/expensive database queries, and it should probably be disabled by default. This means we probably need 2 options
@wadetandy sound about right? |
|
Makes sense and I agree that we should not change the defaults. If we're doing some nice things on behalf of |
|
I would recommend following the JSON spec that > JSON.parse("undefined")
#=> JSON::ParserError (416: unexpected token at 'undefined')
> JSON.parse("null")
#=> nil |
|
Yeah, I agree with @zeisler - also makes sense because in Spraypaint, I would drop Maybe we'll move to a configurable whitelist at some point, but that seems good for now. |
|
In general I would Be in favor of either allowing nil and undefined OR allowing neither, but I’m not going to get too worked up about any outcome here. |
Filters have new options `allow_nil: true` Option can be set at the resource level `Resource.filters_accept_nil_by_default = true` By default this is set to false. graphiti-api#142
Filters have new options `allow_nil: true` Option can be set at the resource level `Resource.filters_accept_nil_by_default = true` By default this is set to false. graphiti-api#142
Filters have new options `allow_nil: true` Option can be set at the resource level `Resource.filters_accept_nil_by_default = true` By default this is set to false. graphiti-api#142
Filters have new options `allow_nil: true` Option can be set at the resource level `Resource.filters_accept_nil_by_default = true` By default this is set to false. graphiti-api#142
Filters have new options `allow_nil: true` Option can be set at the resource level `Resource.filters_accept_nil_by_default = true` By default this is set to false. graphiti-api#142
And convert to Ruby's
nil