techniq/odata-query

option to add custom query params

sg2707 opened this issue · 1 comments

If the endpoint accepts additional query parameters other than oData queryparams, we have to append them after the buildQuery manually. To avoid this can we create a collection of custom parameter object that will be appended to the query?

Eg: myendpoint?oDataParam=xyz&customparam=1

@sg2707 why wouldn't you handle that outside of this package? That's what I do.

A simple example:

const odataParamsString: string = buildQuery({ select: ['foo', 'bar']});
const customParms: string = ['hello=world', 'x=y'].join('&');

const requestUrl: string = `https://foobar.com?${odataParamsString}&${customParms}`;

Overall, I don't think you, as a developer, want your custom query params dependent on an OData package. The best design is to keep them separated.