-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow TransformAction to clone options #64
Allow TransformAction to clone options #64
Conversation
@@ -42,6 +42,14 @@ public static GraphQueryBuilder CreateFromConfig(Action<OptiGraphOptions> transf | |||
var httpClientFactory = ServiceLocator.Current.GetService(typeof(IHttpClientFactory)) as IHttpClientFactory; | |||
if (transformAction != null) | |||
{ | |||
if (options.TransformActionBehaviour == TransformActionBehaviour.Clone) | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I added the TransformActionBehaviour is to avoid changing the behaviour which could potentially be a breaking change. By keeping the Default behaviour a customer can upgrade an existing solution without configuring this option.
But I recognize that this might be unnecessary depending on which use cases that exists. Please keep in mind and consider during review.
804101c
to
af7e021
Compare
Great job @ManhOptimizely! Your CI passed, and the PR has been automatically labelled. Once ready, we will merge this PR to trigger the next part of the automation 🚀 |
When the client is used to query different graph sources the transform action passed to CreateFromConfig can be used to manipulate the keys sent. However the changes are applied to the global options and doesnt reset after the client has finished its query. By introducing a behaviour it is possible to dictatate if the developer wants to be able to apply the transformation on a clone of the options. The default behaviour is that the current behavior where the options are global.
af7e021
to
5f357f6
Compare
Great job @ManhOptimizely! Your CI passed, and the PR has been automatically labelled. Once ready, we will merge this PR to trigger the next part of the automation 🚀 |
When the client is used to query different graph
sources the transform action passed to
CreateFromConfig can be used to manipulate the
keys sent. However the changes are applied to the
global options and doesnt reset after the client
has finished its query.
By introducing a behaviour it is possible to
dictatate if the developer wants to be able to
apply the transformation on a clone of the
options.
The default behaviour is that the current behavior where the options are global.