-
-
Notifications
You must be signed in to change notification settings - Fork 328
Open
Description
I am trying to shift to usingShopifySharp.Extensions.DependencyInjection to register ShopifySharp dependecies, but I am having trouble figuring out how to specify the apiVersion.
I am currently using the GraphService
This is how I was previously registering IGraphService:
services.AddSingleton<IGraphService, GraphService>((provider) =>
{
var config = provider.GetRequiredService<IOptions<ShopifyConfiguration>>().Value;
return new GraphService(config.BaseUrl, config.AccessToken, apiVersion: "unstable");
});
This is my attempt through the DependencyIntjection package, attempting to utilize the LeakyBucketExecutionPolicy
services.AddShopifySharp<LeakyBucketExecutionPolicy>();
services.AddSingleton<IGraphService, GraphService>((provider) =>
{
var factory = provider.GetRequiredService<IGraphServiceFactory>();
var config = provider.GetRequiredService<IOptions<ShopifyConfiguration>>().Value;
var credentials = new ShopifyApiCredentials(config.BaseUrl, config.AccessToken);
// no option to set api version
var service = factory.Create(credentials);
});
Is it possible to set the apiVersion through the DependencyInjection package?
Metadata
Metadata
Assignees
Projects
Status
In Progress