Skip to content

How do I make queries accessible in workflow context? #15436

Closed Answered by weirdyang
weirdyang asked this question in Q&A
Discussion options

You must be logged in to vote

Ok so I found my answer by going into the code and the docs:

Configure template options to add the necessary services and define the name to access it by, the docs was useful in explaining this piece of code


            services.Configure<TemplateOptions>(o =>
            {
                o.Scope.SetValue("Queries", new ObjectValue(new LiquidQueriesAccessor()));
                o.MemberAccessStrategy.Register<LiquidQueriesAccessor, FluidValue>(async (obj, name, context) =>
                {
                    var liquidTemplateContext = (LiquidTemplateContext)context;
                    var queryManager = liquidTemplateContext.Services.GetRequiredService<IQueryManager>();

          …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@weirdyang
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by weirdyang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants