forked from extern/bruno
fix(#354): use Handlebars instead of deprecated Mustache
This commit is contained in:
parent
3c0770b792
commit
d2b35beb6f
@ -1,16 +1,12 @@
|
||||
const Mustache = require('mustache');
|
||||
const Handlebars = require('handlebars');
|
||||
const { getIntrospectionQuery } = require('graphql');
|
||||
const { get } = require('lodash');
|
||||
|
||||
// override the default escape function to prevent escaping
|
||||
Mustache.escape = function (value) {
|
||||
return value;
|
||||
};
|
||||
|
||||
const prepareGqlIntrospectionRequest = (endpoint, envVars, request) => {
|
||||
if (endpoint && endpoint.length) {
|
||||
endpoint = Mustache.render(endpoint, envVars);
|
||||
endpoint = Handlebars.compile(endpoint, { noEscape: true })(envVars);
|
||||
}
|
||||
|
||||
const introspectionQuery = getIntrospectionQuery();
|
||||
const queryParams = {
|
||||
query: introspectionQuery
|
||||
|
Loading…
Reference in New Issue
Block a user