aboutsummaryrefslogtreecommitdiffstats
path: root/bsfs/query/validator.py
diff options
context:
space:
mode:
Diffstat (limited to 'bsfs/query/validator.py')
-rw-r--r--bsfs/query/validator.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/bsfs/query/validator.py b/bsfs/query/validator.py
index 6e3afa1..b259ea0 100644
--- a/bsfs/query/validator.py
+++ b/bsfs/query/validator.py
@@ -37,6 +37,10 @@ class Filter():
self.schema = schema
def __call__(self, root_type: bsc.Node, query: ast.filter.FilterExpression):
+ """Alias for `Filter.validate`."""
+ return self.validate(root_type, query)
+
+ def validate(self, root_type: bsc.Node, query: ast.filter.FilterExpression):
"""Validate a filter *query*, assuming the subject having *root_type*.
Raises a `bsfs.utils.errors.ConsistencyError` if the query violates the schema.
@@ -237,7 +241,11 @@ class Fetch():
def __init__(self, schema: bsc.Schema):
self.schema = schema
- def __call__(self, root_type: bsc.Node, query: ast.fetch.FetchExpression):
+ def __call__(self, root_type: bsc.Node, query: ast.filter.FilterExpression):
+ """Alias for `Fetch.validate`."""
+ return self.validate(root_type, query)
+
+ def validate(self, root_type: bsc.Node, query: ast.fetch.FetchExpression):
"""Validate a fetch *query*, assuming the subject having *root_type*.
Raises a `bsfs.utils.errors.ConsistencyError` if the query violates the schema.