File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,14 @@ detect internal server errors.
1515
1616## Usage
1717
18- `` hypothesis_graphql `` exposes the `` from_schema ` ` function, which takes a GraphQL schema and returns a Hypothesis strategy for
19- defined queries and mutations.
18+ ` hypothesis_graphql ` exposes the ` from_schema ` function, which takes a GraphQL schema and returns a Hypothesis strategy for
19+ defined queries and mutations:
2020
21- Lets take this schema as an example:
21+ ``` python
22+ from hypothesis import given
23+ from hypothesis_graphql import from_schema
2224
23- ``` graphql
25+ SCHEMA = """
2426type Book {
2527 title: String
2628 author: Author
@@ -40,15 +42,7 @@ type Mutation {
4042 addBook(title: String!, author: String!): Book!
4143 addAuthor(name: String!): Author!
4244}
43- ```
44-
45- Then you can generate queries or mutations like this :
46-
47- ```python
48- from hypothesis import given
49- from hypothesis_graphql import from_schema
50-
51- SCHEMA = "..." # the one above
45+ """
5246
5347
5448@given (from_schema(SCHEMA ))
You can’t perform that action at this time.
0 commit comments