Adding graph ql for Helm versions (#21)

* Adding graphql query to fetch latest helm release of specified type

* Updating typescript version and js file

* Fixing PR comments in release

* Adding feature flag as environment variable in release

* Changing feature flag name

* Updating files as per latest changes in master after resolving merge conflicts

* Removing non prod modules
This commit is contained in:
shigupt202
2021-03-31 10:51:13 +05:30
committed by GitHub
parent d55017e2a0
commit 18bc768116
365 changed files with 48161 additions and 800510 deletions

View File

@ -0,0 +1,22 @@
import fetchWrapper from "./fetch-wrapper";
export default function withDefaults(oldEndpoint, newDefaults) {
const endpoint = oldEndpoint.defaults(newDefaults);
const newApi = function (route, parameters) {
const endpointOptions = endpoint.merge(route, parameters);
if (!endpointOptions.request || !endpointOptions.request.hook) {
return fetchWrapper(endpoint.parse(endpointOptions));
}
const request = (route, parameters) => {
return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
};
Object.assign(request, {
endpoint,
defaults: withDefaults.bind(null, endpoint),
});
return endpointOptions.request.hook(request, endpointOptions);
};
return Object.assign(newApi, {
endpoint,
defaults: withDefaults.bind(null, endpoint),
});
}