How to use the conseiljs.ConseilQueryBuilder.blankQuery function in conseiljs

To help you get started, we’ve selected a few conseiljs 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 Cryptonomic / Arronax / src / reducers / app / thunks.ts View on Github external
) => async (dispatch: any) => {
  let defaultQuery = (urlEntity === entity && urlQuery) ? JSON.parse(base64url.decode(urlQuery)) : defaultQueries[entity];
  defaultQuery = {...ConseilQueryBuilder.blankQuery(), ...defaultQuery};
  let columns: any[] = [];
  let sorts: Sort[];
  let filters: Filter[] = [];
  let aggregations: Aggregation[] = [];
  let cardinalityPromises: any[] = [];
  let query = blankQuery();
  const sortedAttributes = sortAttributes(attributes);
  const levelColumn = attributes.find(column => column.name === 'level' || column.name === 'block_level' || column.name === 'timestamp') || sortedAttributes[0];

  if (defaultQuery) {
    const { fields, predicates, orderBy } = defaultQuery;
    query = defaultQuery;
    // initColumns
    if (fields.length > 0) {
      fields.forEach(field=> {
        const column = attributes.find(attr => attr.name === field);