Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SERVICES-2427] Search by token (ID/ticker/name) for pairs and tokens queries #1362

Merged
merged 5 commits into from
Jun 5, 2024

Conversation

mad2sm0key
Copy link
Contributor

@mad2sm0key mad2sm0key commented Jun 3, 2024

Reasoning

  • allow filtering by a partial search term for tokens and pairs (to be used for quick-search capability)

Proposed Changes

  • add searchToken field to PairsFilter and TokensFilter input args
  • add filtering method that checks for presence of search term in the first or second tokens identifier, ticker or name (pairs filtering service)
  • add filtering method that checks for presence of search term in the tokens identifier, ticker or name (tokens filtering service)

How to test

  • On filteredPairs query should return all pairs where the first or second tokens identifier, ticker or name contain the string crypt:
query {
  filteredPairs(
    filters:{
      searchToken:"crypt"
    }
  ) {
    edges {
      cursor
      node {
        address
        firstToken {
          identifier
          name
          ticker
        }
        secondToken {
          identifier
          name
          ticker
        }
      }
    }
    pageInfo {
      startCursor
      endCursor
    }
    pageData {
      count
      limit
      offset
    }
  }
}

On filteredTokens query should return all tokens with the identifier, name or ticker containing the string crypt:

query {
  filteredTokens(
    filters:{
      searchToken:"crypt"
    }
  ) {
    edges {
      cursor
      node {
        identifier
        name
        ticker
        price
      }
    }
    pageInfo {
      startCursor
      endCursor
    }
    pageData {
      count
      limit
      offset
    }
  }
}

@mad2sm0key mad2sm0key changed the title [SERVICES-2427] Pairs query wildcard filtering by token ID, name or ticker [SERVICES-2427] Search by token (ID/ticker/name) for pairs and tokens queries Jun 4, 2024
@mad2sm0key mad2sm0key marked this pull request as ready for review June 4, 2024 06:24
gabrielmatei
gabrielmatei previously approved these changes Jun 4, 2024
cfaur09
cfaur09 previously approved these changes Jun 4, 2024
- add min 3 chars limit for performing search
- update router service unit tests (remove pair service mock + use existing mocked providers as dependencies)
@mad2sm0key mad2sm0key dismissed stale reviews from cfaur09 and gabrielmatei via 4ff5a27 June 4, 2024 14:17
@mad2sm0key mad2sm0key merged commit 9ce329e into development Jun 5, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants