@emeryld/rrroutes-client 2.4.4 → 2.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -108,6 +108,7 @@ function toArgsTuple(args) {
108
108
  function buildUrl(leaf, baseUrl, params, query) {
109
109
  const normalizedParams = leaf.cfg.paramsSchema ? lowProfileParse(leaf.cfg.paramsSchema, params) : {};
110
110
  const normalizedQuery = leaf.cfg.querySchema ? lowProfileParse(leaf.cfg.querySchema, query) : {};
111
+ console.log("buildUrl", { query, normalizedQuery });
111
112
  const path = compilePath(
112
113
  leaf.path,
113
114
  normalizedParams ?? {}
@@ -236,7 +237,10 @@ function buildGetLeaf(leaf, rqOpts, env) {
236
237
  const fetchEndpoint = async (tuple, options) => {
237
238
  const a = extractArgs(tuple);
238
239
  const params = a?.params;
239
- const query = options?.queryOverride ?? a?.query;
240
+ const query = {
241
+ ...a?.query ?? {},
242
+ ...options?.queryOverride ?? {}
243
+ };
240
244
  const { url, normalizedQuery, normalizedParams } = buildUrl(
241
245
  { ...leaf, cfg: leafCfg },
242
246
  baseUrl,
@@ -499,7 +503,10 @@ function buildInfiniteGetLeaf(leaf, rqOpts, env) {
499
503
  const fetchEndpoint = async (tuple, options) => {
500
504
  const a = extractArgs(tuple);
501
505
  const params = a?.params;
502
- const query = options?.queryOverride ?? a?.query;
506
+ const query = {
507
+ ...a?.query ?? {},
508
+ ...options?.queryOverride ?? {}
509
+ };
503
510
  const { url, normalizedQuery, normalizedParams } = buildUrl(
504
511
  { ...leaf, cfg: leafCfg },
505
512
  baseUrl,
@@ -796,7 +803,10 @@ function buildMutationLeaf(leaf, rqOpts, env) {
796
803
  const fetchEndpoint = async (tuple, options) => {
797
804
  const a = extractArgs(tuple);
798
805
  const params = a?.params;
799
- const query = options?.queryOverride ?? a?.query;
806
+ const query = {
807
+ ...a?.query ?? {},
808
+ ...options?.queryOverride ?? {}
809
+ };
800
810
  const { url, normalizedQuery, normalizedParams } = buildUrl(
801
811
  { ...leaf, cfg: leafCfg },
802
812
  baseUrl,