Closed lingfromSh closed 3 years ago
@lingfromSh:
Awesome, thanks! I'll prepare a release soon.
@lingfromSh:
Sorry, this broke quite a few things. The following query used to work fine before. Now it does not. Could you fix that?
query {
allReadOnlyPostDocuments(search:{content:{value:"Alice"}}) {
edges {
node {
category
title
}
}
}
}
Additionally, this creates a backwards compatibility issue. The following query used to work before. Now it does not, unless you replace author
with author{age, name}
:
{
allPostDocuments {
edges {
node {
id
comments {
author
tag
content
createdAt
}
}
}
}
}
I figured out the reason why tests failed.
class BaseBackend:
def __init__(self, args=None):
self.args = args or {}
class BackendA(BaseBackend):
...
class BackendB(BaseBackend):
...
if __name__ == "__main__":
data = {
"key1": "value1",
"key2": {
"nested_key1": {},
"nested_key2": "nested_value2"
}
}
backend_a = BackendA(args=dict(data))
backend_b = BackendB(args=dict(data))
backend_a.args.update(key1="changed")
print(backend_b.args) # {'key1': 'value1', 'key2': {'nested_key1': {}, 'nested_key2': 'nested_value2'}}
backend_a.args['key2'].update(nested_key1="changed")
print(backend_b.args) # {'key1': 'value1', 'key2': {'nested_key1': 'changed', 'nested_key2': 'nested_value2'}}
print(backend_a.args["key2"] is backend_b.args['key2']) # True
When CompoundSearchFilterBackend
and SearchFilterBackend
both did pop operation on the same dict, the tests failed.
Added nested search support.
The final query will be this. I just combine input with configured, so there will be some duplicated query.
Some problems: