Do not force QueryValidator to use List#751
Do not force QueryValidator to use List#751bjing wants to merge 1 commit intosangria-graphql:mainfrom
Conversation
|
Sorry, I somehow missed that PR. The list of rules is normally created once with the schema for the whole application's life. Given that, I am not sure if this optimization brings much value. |
|
Hi @yanns thanks for getting back to me. I no longer work at the place where this change is needed, and I can no longer provide an example where this causes an issue, it was indeed an issue for us back then. However, from a design point of view, I think it's always nice to use more of a base type (or interface) instead of something like a Anyway, since I no longer work with Sangria, feel free to disregard this PR. |
|
I see your point. |
Do not force the use of
Listtype for rules when creating aQueryValidator.List is not a very efficient type and forcing the clients to create rules in
Listhas no obvious benefit because Sangeria is not using any functionality from an actualListtype.This gives the users the flexibility to use the types they need, if they need
ListorVectoror anything else, this will allow them to do it.Also, for the
def validateUsingRules()function, since visitors parameter only gets iterated once, there's no need to mandate any collection type other than anIterable.