How to use odata-query - 2 common examples

To help you get started, we’ve selected a few odata-query examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github techniq / react-odata / src / OData.js View on Github external
function buildUrl(baseUrl, query) {
  return query !== false && baseUrl + buildQuery(query);
}
github relair / odata-data-source / projects / odata-data-source / src / lib / odata-data-source.ts View on Github external
query.orderBy = [`${sortBy} desc`];
      }
    } else if (this.initialSort && this.initialSort.length) {
      query.orderBy = this.initialSort;
    }

    if (filters) {
      const filterQuery = { and: [] };
      filters.forEach(filter => {
        filterQuery.and.push(filter.getFilter());
      });

      query.filter = filterQuery;
    }

    url = url + buildQuery(query);
      
    return this.httpClient.get(url) as Observable;
  }

odata-query

OData v4 query builder that uses a simple object-based syntax similar to MongoDB and js-data

MIT
Latest version published 8 months ago

Package Health Score

64 / 100
Full package analysis

Popular odata-query functions