Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Add optional context argument to ArtemisClient#310

Closed
matehat wants to merge 1 commit into
comigor:betafrom
matehat:beta
Closed

Add optional context argument to ArtemisClient#310
matehat wants to merge 1 commit into
comigor:betafrom
matehat:beta

Conversation

@matehat
Copy link
Copy Markdown

@matehat matehat commented May 15, 2021

What does this PR do/solve?

This non-breaking change to ArtemisClient allows a caller to provide additional Context information to queries (on both execute or stream).

For example, the following would add a request-specific header to a GraphQL query, just before sending it:

import 'package:graphql/client.dart' as graphql;

final requestUuid = Uuid().v4();
artemisClient.execute(
  query, 
  context: graphql.Context.fromList([
    graphql.HttpLinkHeaders(headers: {'x-request-id': requestUuid})
  ]),
);

/cc @Pacane

@matehat
Copy link
Copy Markdown
Author

matehat commented Aug 9, 2021

Any chance we can consider this PR?

@comigor

@comigor
Copy link
Copy Markdown
Owner

comigor commented Aug 9, 2021

oh wow, we've merged basically the same code a couple of months ago #324 (available since 7.0.0-beta.14)

@matehat
Copy link
Copy Markdown
Author

matehat commented Aug 13, 2021

Actually glad to hear it! Thanks

@matehat matehat closed this Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants