You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hypothesis strategies for GraphQL operations. Allows you to generate arbitrary GraphQL queries for the given schema.
11
-
It starts with simple examples and iteratively goes to more complex ones.
10
+
<h4align="center">
11
+
Generate queries matching your GraphQL schema, and use them to verify your backend implementation
12
+
</h4>
12
13
13
-
For web API testing, [Schemathesis](https://github.com/schemathesis/schemathesis) provides a higher-level wrapper and can
14
-
detect internal server errors.
14
+
It is a Python library that provides a set of [Hypothesis](https://github.com/HypothesisWorks/hypothesis/tree/master/hypothesis-python) strategies that
15
+
let you write tests parametrized by a source of examples.
16
+
Generated queries have arbitrary depth and may contain any subset of GraphQL types defined in the input schema.
17
+
They expose edge cases in your code that are unlikely to be found otherwise.
18
+
19
+
For web API testing, [Schemathesis](https://github.com/schemathesis/schemathesis) provides a higher-level wrapper around this library.
15
20
16
21
## Usage
17
22
18
-
`hypothesis_graphql`exposes the `from_schema` function, which takes a GraphQL schema and returns a Hypothesis strategy for
19
-
defined queries and mutations:
23
+
`hypothesis_graphql`provides the `from_schema` function, which takes a GraphQL schema and returns a Hypothesis strategy for
24
+
GraphQL queries matching the schema:
20
25
21
26
```python
22
27
from hypothesis import given
23
28
from hypothesis_graphql import from_schema
24
29
30
+
# Strings and `graphql.GraphQLSchema` are supported
0 commit comments