⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@rosalyntan
Copy link
Member

@rosalyntan rosalyntan commented Jan 14, 2026

Description

  1. Move the onGraphRequest to a separate firebase-functions/dataconnect/graphql to avoid its optional peer dependencies from affecting other firebase-functions methods. Note: we are not exporting graphql from firebase-functions for the same reason. This means an import statement like import {graphql} from firebase-functions will not work; developers will need to use import {onGraphRequest} from firebase-functions/dataconnect/graphql instead.

  2. Import ApolloServer and expressMiddleware statically instead of dynamically, now that the firebase-functions/dataconnect/graphql module is isolated. This allows missing dependencies to be a deploy time rather than a runtime error if missing, while still not affecting usage of other firebase-functions namespaces.

Tested: https://paste.googleplex.com/6219756904513536

Code sample

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @rosalyntan, 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 significantly refactors the dataconnect provider by isolating GraphQL-specific functionality into its own module. This change enhances the overall modularity of the codebase and optimizes dependency management by making the graphql dependency optional, thereby reducing the footprint for users who do not utilize GraphQL features within Data Connect.

Highlights

  • Modularization of GraphQL Functionality: The onGraphRequest function, along with its associated types and server initialization logic, has been extracted from src/v2/providers/dataconnect.ts and moved into a new, dedicated module at src/v2/providers/dataconnect/graphql.ts.
  • Dependency Isolation: The graphql package is now explicitly listed as an optional peer dependency. This ensures that the graphql dependency is only required when the GraphQL functionality is actively used, preventing unnecessary loading for other dataconnect methods.
  • Namespace and Export Updates: The package.json and package-lock.json files have been updated to reflect the new module structure, introducing a new export path for ./dataconnect/graphql and adjusting existing dataconnect exports to point to the new nested directory.

🧠 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.

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 effectively refactors the GraphQL-related logic out of the main dataconnect module, which is a great improvement for modularity and making dependencies optional. The file restructuring and package.json changes look correct. However, I've identified a critical issue where the tests are now broken, and a high-severity bug in the new graphql.ts module related to state management that could cause incorrect behavior when multiple GraphQL endpoints are defined. Please see my detailed comments for suggestions on how to resolve these issues.

@rosalyntan rosalyntan marked this pull request as ready for review January 16, 2026 01:15
@rosalyntan rosalyntan requested a review from taeold January 16, 2026 01:16
Copy link
Contributor

@taeold taeold left a comment

Choose a reason for hiding this comment

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

Please add some changelog entry - the release automation fails if CHANGELOG.md is empty 😬

"peerDependencies": {
"@apollo/server": "^5.2.0",
"@as-integrations/express4": "^1.1.2",
"graphql": "^16.12.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

huh do you remember why we didn't add this last time?

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