hurl/integration/tests_ok/graphql.json
2022-11-25 11:34:03 +01:00

2 lines
2.2 KiB
JSON

{"entries":[{"request":{"method":"POST","url":"http://localhost:8000/graphql","body":{"type":"graphql","value":"{\n allFilms {\n films {\n title\n director\n releaseDate\n }\n }\n}\n"}},"response":{"status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.data.allFilms.films"},"filters":[{"type":"count"}],"predicate":{"type":"equal","value":6}},{"query":{"type":"jsonpath","expr":"$.data.allFilms.films[0].title"},"predicate":{"type":"equal","value":"A New Hope"}},{"query":{"type":"jsonpath","expr":"$.data.allFilms.films[0].director"},"predicate":{"type":"equal","value":"George Lucas"}},{"query":{"type":"jsonpath","expr":"$.data.allFilms.films[0].releaseDate"},"predicate":{"type":"equal","value":"1977-05-25"}},{"query":{"type":"jsonpath","expr":"$.data.allFilms.films[0].openingCrawl"},"predicate":{"not":true,"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.data.allFilms.films[1].title"},"predicate":{"type":"equal","value":"The Empire Strikes Back"}},{"query":{"type":"jsonpath","expr":"$.data.allFilms.films[2].title"},"predicate":{"type":"equal","value":"Return of the Jedi"}}]}},{"request":{"method":"POST","url":"http://localhost:8000/graphql","body":{"type":"graphql","value":"query Query {\n allFilms {\n films {\n title\n director\n releaseDate\n }\n }\n}\n"}},"response":{"status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.data.allFilms.films"},"filters":[{"type":"count"}],"predicate":{"type":"equal","value":6}}]}},{"request":{"method":"POST","url":"http://localhost:8000/graphql","body":{"type":"graphql","value":"query Person($id: ID!) {\n person(id: $id) {\n name\n }\n}\n\nvariables {\n \"id\": \"cGVvcGxlOjQ=\"\n}\n"}},"response":{"status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.data.person.name"},"predicate":{"type":"equal","value":"Darth Vader"}}]}},{"request":{"method":"POST","url":"http://localhost:8000/graphql","body":{"type":"graphql","value":"query Person($id: ID!) {\n person(id: $id) {\n name\n }\n}\n\nvariables {\n \"id\": \"{{id}}\"\n}\n"}},"response":{"status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.data.person.name"},"predicate":{"type":"equal","value":"Darth Vader"}}]}}]}