Skip to content

feat(graphql): add viewerBlocks field in actor#217

Merged
dahlia merged 1 commit intohackers-pub:mainfrom
Nebu1eto:feat/query-blocked
Mar 2, 2026
Merged

feat(graphql): add viewerBlocks field in actor#217
dahlia merged 1 commit intohackers-pub:mainfrom
Nebu1eto:feat/query-blocked

Conversation

@Nebu1eto
Copy link
Contributor

@Nebu1eto Nebu1eto commented Mar 2, 2026

This PR add viewerBlocks: Boolean! field to Actor. Resolve it from blockingTable (viewer -> actor block relation). Return false when the viewer is not authenticated.

Summary by CodeRabbit

  • New Features
    • Added viewerBlocks field to Actor queries, enabling users to check whether they are currently blocking a specific actor.

Signed-off-by: Haze Lee <hazelee@realignist.me>
@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c21d33b and 5b17177.

📒 Files selected for processing (2)
  • graphql/actor.ts
  • graphql/schema.graphql

📝 Walkthrough

Walkthrough

A new viewerBlocks field was added to the Actor GraphQL type with a resolver that checks the blocking table to determine if the authenticated viewer blocks the target actor, returning false when no viewer is authenticated.

Changes

Cohort / File(s) Summary
Viewer Blocking Relationship
graphql/actor.ts, graphql/schema.graphql
Added viewerBlocks field to Actor type. The resolver queries the blocking table to check if the viewer has blocked the actor, mirroring the pattern of existing viewer-context fields like viewerFollows.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • dahlia

Poem

🐰 A rabbit hops through the schema so bright,
Adding blocks to keep unwanted viewers out of sight,
viewerBlocks now stands tall and true,
Checking the table through and through! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change—adding a viewerBlocks field to the Actor GraphQL type—and is concise and specific.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the GraphQL API by adding a new field to the Actor type. This field allows clients to easily determine if the currently authenticated user is blocking another specific actor, providing crucial information for user interface logic related to social interactions and privacy settings.

Highlights

  • New GraphQL Field: Introduced a new viewerBlocks: Boolean! field to the Actor GraphQL type, which indicates whether the authenticated viewer is blocking a specific actor.
  • Resolver Implementation: Implemented the resolver for the viewerBlocks field, which queries the blockingTable to determine the blocking status. The field returns false if the viewer is not authenticated.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • graphql/actor.ts
    • Added the viewerBlocks field resolver to the Actor type definition.
    • Implemented logic to check for an authenticated viewer and query the blockingTable to resolve the blocking status.
  • graphql/schema.graphql
    • Updated the Actor type definition to include the new viewerBlocks: Boolean! field.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a viewerBlocks boolean field to the Actor type in the GraphQL schema. The field correctly resolves whether the current viewer has blocked a given actor by checking the blockingTable. The implementation is straightforward and follows the pattern of similar fields like viewerFollows. I've added one suggestion to slightly optimize the database query for better performance.

@Nebu1eto Nebu1eto marked this pull request as ready for review March 2, 2026 11:25
@dahlia dahlia merged commit bbdc619 into hackers-pub:main Mar 2, 2026
5 checks passed
@Nebu1eto Nebu1eto deleted the feat/query-blocked branch March 2, 2026 21:39
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.

2 participants