What is the feature?
Pass http query string or body arguments from components to agent’s smart Chart
What problem does this solve for you?
It helps me avoid to duplicate my smart chart, or code a very complex component, by simply using URL query string or http body
Who else would be using this feature?
It would solve issues for other people that tried similar solution :
In a smart Component I would like to call the agent smart chart with parameters.
It could be query string :

Or a method POST body :
And in my agent.js code I would find my arguments :

or

But, I don’t have them for now and I found the culprit inside the NPM package @forestadmin/agent.
In the file dist/utils/query-string.js, is defined the class QueryStringParser, which have a parseCaller static method that return the value to set in context.caller.
But as the code shows :
context.request.query is not passed, and context.request.body neither. If we had the following changes :
line 97 const { ip, query, body } = context.request;
line 133 request: { ip, query, body },
The data would be accessible to the smartChart
This come as a suggestion but you get the need.
I work with “@forestadmin/agent”: “^1.72.11” in my package.json


