MCPcopy Create free account
hub / github.com/Devographics/Monorepo / getQueryArgsString

Function getQueryArgsString

shared/fetch/queries/question_data.ts:72–101  ·  view source on GitHub ↗
({
    facet,
    filters,
    parameters,
    xAxis,
    yAxis
}: QueryArgs)

Source from the content-addressed store, hash-verified

70}
71
72export const getQueryArgsString = ({
73 facet,
74 filters,
75 parameters,
76 xAxis,
77 yAxis
78}: QueryArgs): string | undefined => {
79 const args: ResponseArgumentsStrings = {}
80 if (facet) {
81 args.facet = facetItemToFacet(facet)
82 }
83 if (filters && !isEmpty(filters)) {
84 args.filters = unquote(JSON.stringify(filters))
85 }
86 if (parameters && !isEmpty(parameters)) {
87 args.parameters = unquote(JSON.stringify(parameters))
88 }
89 // for data explorer
90 if (yAxis && !isEmpty(yAxis)) {
91 args.axis1 = yAxis
92 }
93 if (xAxis && !isEmpty(xAxis)) {
94 args.axis2 = xAxis
95 }
96 if (isEmpty(args)) {
97 return ''
98 } else {
99 return wrapArguments(args)
100 }
101}
102
103export const getQuestionDataQuery = ({
104 queryOptions,

Callers 1

getQuestionDataQueryFunction · 0.70

Calls 4

isEmptyFunction · 0.85
facetItemToFacetFunction · 0.70
unquoteFunction · 0.70
wrapArgumentsFunction · 0.70

Tested by

no test coverage detected