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

fix: gql where args #298

Merged
merged 3 commits into from
Jan 24, 2024
Merged

fix: gql where args #298

merged 3 commits into from
Jan 24, 2024

Conversation

ruslan-sh-r
Copy link
Contributor

@ruslan-sh-r ruslan-sh-r commented Jan 24, 2024

Summary by CodeRabbit

  • Chores

    • Updated .gitignore to exclude a specific directory.
  • New Features

    • Enhanced the generation of GraphQL queries for better performance and reliability.
  • Tests

    • Improved test cases to include more specific filtering criteria.

Copy link
Contributor

coderabbitai bot commented Jan 24, 2024

Walkthrough

The recent updates encompass ignoring a new directory in version control, enhancing the GraphQL query building in the indexer component, and refining a test function with additional filtering conditions. These changes aim to streamline development workflow, improve the reliability of code involving data fetching, and ensure more precise test results.

Changes

File Path Change Summary
.gitignore Added nibiru/ directory to ignore list.
src/indexer-nibi/gql.ts Enhanced object-to-string conversion for GraphQL queries; updated related functions for robustness.
src/indexer-nibi/heart-monitor.test.ts Refined test function with new filtering criteria for userContracts.

Poem

🐇 "In the burrow of the code, a change does spring 🌱
📁 A nibiru ignored, as the queries take wing 🕊️
🧪 Tests now sharper, with a criterion new,
🎉 A hop, skip, and jump; to bugs, we say adieu!" 🎊

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 462bbe8 and 80c6f0d.
Files selected for processing (3)
  • .gitignore (1 hunks)
  • src/indexer-nibi/gql.ts (2 hunks)
  • src/indexer-nibi/heart-monitor.test.ts (1 hunks)
Additional comments: 5
src/indexer-nibi/gql.ts (3)
  • 12-32: The objToGql function has been updated to handle object conversion more robustly. Ensure that the conversion logic correctly handles all edge cases, especially since JSON.stringify is used for non-object types, which could introduce quotes around strings that may not be desired in all GraphQL contexts.
  • 34-37: The getWhereArgArr function now uses the updated objToGql to construct the where clause. Verify that the where clause generated by this function is correctly formatted and that all callers of this function have been updated to handle the new return type if it has changed.
  • 102-107: The gqlQuery function has been adjusted to improve query generation. The introduction of the res variable to store the result before returning is a good practice for debugging and readability. However, ensure that the logic for including parentheses around the query arguments is correct and that the excludeParentObject parameter is being used appropriately by all callers.
.gitignore (1)
  • 206-207: The addition of the nibiru/ directory to .gitignore is a straightforward change. Confirm that this directory is indeed not needed in the version control and that no required files are being ignored.
src/indexer-nibi/heart-monitor.test.ts (1)
  • 1019-1022: The testWasm function now includes additional filtering criteria for userContracts. Ensure that the new conditions (contractAddress like "123" and userAddress equal to "456") are correctly implemented and that all test cases have been updated to reflect these changes.

Copy link

github-actions bot commented Jan 24, 2024

Lines Statements Branches Functions
Coverage: 96%
96.82% (6036/6234) 98.13% (683/696) 85% (187/220)

src/indexer-nibi/gql.ts Outdated Show resolved Hide resolved
src/indexer-nibi/gql.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 80c6f0d and c617dda.
Files selected for processing (1)
  • src/indexer-nibi/gql.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/indexer-nibi/gql.ts

@CalicoNino
Copy link
Contributor

CalicoNino commented Jan 24, 2024

Sonar test coverage failing check, to be fixed in later PR

@CalicoNino CalicoNino merged commit b57ef0a into develop Jan 24, 2024
1 check failed
@CalicoNino CalicoNino deleted the fix/gql-where-args branch January 24, 2024 14:47
CalicoNino added a commit that referenced this pull request Jan 24, 2024
* fix: gql where args (#298)

* fix: gql where obj to gql string

* fix: review comments

* chore: pr title lint workflow (#293)

---------

Co-authored-by: Ruslan Shakirov <[email protected]>
nibibot pushed a commit that referenced this pull request Jan 24, 2024
### [2.0.1](v2.0.0...v2.0.1) (2024-01-24)

### Miscellaneous Chores

* gql when args fix ([#299](#299)) ([10776c2](10776c2)), closes [#298](#298) [#293](#293)

 [skip ci]
nibibot pushed a commit that referenced this pull request Feb 5, 2024
## [3.0.0](v2.0.1...v3.0.0) (2024-02-05)

### Bug Fixes

* fix merge ([4f93be8](4f93be8))
* gql where args ([#298](#298)) ([b57ef0a](b57ef0a))
* more file reorg ([#300](#300)) ([d6a053a](d6a053a))

### Miscellaneous Chores

* pr title lint workflow ([#293](#293)) ([b5dd050](b5dd050))

### Code Refactors

* tests ([#301](#301)) ([e14b83b](e14b83b))

 [skip ci]
@nibibot
Copy link

nibibot commented Feb 5, 2024

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants