GraphQL
Source file: examples/graphql_protocol.hen
What It Demonstrates
protocol = graphqloperationandvariablesdirectives~~~graphqlrequest bodiesgraphql.data...selectors
Key Pattern
protocol = graphql
POST {{ GQL_ORIGIN }}
operation = GetUser
variables = {"getUserId":"abc1234"}
~~~graphql
query GetUser($getUserId: String) {
getUser(id: $getUserId) {
id
name
}
}
~~~
Run It
hen verify ./examples/graphql_protocol.hen
hen run ./examples/graphql_protocol.hen 0 --non-interactive
What To Notice
- GraphQL still executes over HTTP, so status, headers, and ordinary body access remain available.
- Successful responses may omit
errorsentirely, sographql.data...is the most stable selector for positive assertions.
Related reference: Protocols