File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1717use Behat \Gherkin \Node \PyStringNode ;
1818use Behatch \Context \RestContext ;
1919use Behatch \HttpCall \Request ;
20+ use GraphQL \Type \Introspection ;
2021
2122/**
2223 * Context for GraphQL.
@@ -95,6 +96,15 @@ public function ISendTheGraphqlRequestWithOperation(string $operation)
9596 $ this ->sendGraphqlRequest ();
9697 }
9798
99+ /**
100+ * @When I send the query to introspect the schema
101+ */
102+ public function ISendTheQueryToIntrospectTheSchema ()
103+ {
104+ $ this ->graphqlRequest = ['query ' => Introspection::getIntrospectionQuery ()];
105+ $ this ->sendGraphqlRequest ();
106+ }
107+
98108 private function sendGraphqlRequest ()
99109 {
100110 $ this ->request ->setHttpHeader ('Accept ' , null );
Original file line number Diff line number Diff line change @@ -9,20 +9,13 @@ Feature: GraphQL introspection support
99 And the JSON node "errors[0].message" should be equal to "GraphQL query is not valid"
1010
1111 Scenario : Introspect the GraphQL schema
12- When I send the following GraphQL request:
13- """
14- {
15- __schema {
16- types {
17- name
18- }
19- }
20- }
21- """
12+ When I send the query to introspect the schema
2213 Then the response status code should be 200
2314 And the response should be in JSON
2415 And the header "Content-Type" should be equal to "application/json"
2516 And the JSON node "data.__schema.types" should exist
17+ And the JSON node "data.__schema.queryType.name" should be equal to "Query"
18+ And the JSON node "data.__schema.mutationType.name" should be equal to "Mutation"
2619
2720 Scenario : Introspect types
2821 When I send the following GraphQL request:
You can’t perform that action at this time.
0 commit comments