hurl/integration/tests_ok/graphql.json

2 lines
2.7 KiB
JSON
Raw Normal View History

2023-06-24 13:11:46 +03:00
{"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","headers":[{"name":"Content-Type","value":"application/json"}],"body":{"type":"json","value":{"query":"{\n allFilms {\n films {\n title\n director\n releaseDate\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 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","options":[{"name":"variable","value":"id=cGVvcGxlOjQ="}],"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"}}]}}]}