@@ -42,39 +42,45 @@ class ArtemisClient {
4242
4343 /// Executes a [GraphQLQuery] , returning a typed response.
4444 Future <GraphQLResponse <T >> execute <T , U extends JsonSerializable >(
45- GraphQLQuery <T , U > query,
46- ) async {
45+ GraphQLQuery <T , U > query, {
46+ Context context = const Context (),
47+ }) async {
4748 final request = Request (
4849 operation: Operation (
4950 document: query.document,
5051 operationName: query.operationName,
5152 ),
5253 variables: query.getVariablesMap (),
54+ context: context,
5355 );
5456
5557 final response = await _link.request (request).first;
5658
5759 return GraphQLResponse <T >(
5860 data: response.data == null ? null : query.parse (response.data ?? {}),
5961 errors: response.errors,
62+ context: response.context,
6063 );
6164 }
6265
6366 /// Streams a [GraphQLQuery] , returning a typed response stream.
6467 Stream <GraphQLResponse <T >> stream <T , U extends JsonSerializable >(
65- GraphQLQuery <T , U > query,
66- ) {
68+ GraphQLQuery <T , U > query, {
69+ Context context = const Context (),
70+ }) {
6771 final request = Request (
6872 operation: Operation (
6973 document: query.document,
7074 operationName: query.operationName,
7175 ),
7276 variables: query.getVariablesMap (),
77+ context: context,
7378 );
7479
7580 return _link.request (request).map ((response) => GraphQLResponse <T >(
7681 data: response.data == null ? null : query.parse (response.data ?? {}),
7782 errors: response.errors,
83+ context: response.context,
7884 ));
7985 }
8086
0 commit comments