closes #900
BREAKING CHANGE:
This introduces a new API for the test client.
Before:
ts
ctx.app.query
Now:
ts
ctx.client.send
Part of the motivation for a client namespace is for additional API surface area, like the purpose of this PR, headers:
ts
ctx.client.headers.set('foo', 'bar')
Also while ctx.app.query
is very literate in a sense, its arguably better to treat client
as a peer property to the thing its interacting with than a nested property.
The reason we don't use ctx.client.query
is that such naming overloads query
too much. Query is also a kind of operation graphql clients can send to GraphQL servers. Interestingly I noted in a recent Apollo webcast that they made an effort to use the term "operation" instead of query. Also there is some new spec work going in the GraphQL working group to greatly de-overload query and be more precise about how that word is used.
TODO
- [x] docs
- [x] tests
该提问来源于开源项目:prisma-labs/graphql-framework-experiment