Skip to content

Commit 321d33e

Browse files
committed
docs: Update README.md
1 parent 3a42a53 commit 321d33e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ query = """
4444
complexity = get_complexity(
4545
query=query,
4646
schema=schema,
47-
estimator=SimpleEstimator(complexity=1, multiplier=10)
47+
estimator=SimpleEstimator(complexity=10)
4848
)
4949
if complexity > 10:
5050
raise Exception("Query is too complex")
@@ -73,7 +73,7 @@ it by another **constant** which is propagated along the depth of the query.
7373
from graphql_complexity import SimpleEstimator
7474

7575

76-
estimator = SimpleEstimator(complexity=2, multiplier=1)
76+
estimator = SimpleEstimator(complexity=2)
7777
```
7878

7979
Given the following GraphQL query:
@@ -150,13 +150,10 @@ from graphql_complexity import ComplexityEstimator
150150

151151

152152
class CustomEstimator(ComplexityEstimator):
153-
def get_field_complexity(self, node, key, parent, path, ancestors) -> int:
153+
def get_field_complexity(self, node, type_info, path) -> int:
154154
if node.name.value == "specificField":
155155
return 100
156156
return 1
157-
158-
def get_field_multiplier(self, node, key, parent, path, ancestors) -> int:
159-
return 1
160157
```
161158

162159

0 commit comments

Comments
 (0)