Skip to content

Extract accounts connector from example connector#151

Merged
dijimsta merged 2 commits into
mainfrom
extract-accounts-data-connector
Jul 6, 2026
Merged

Extract accounts connector from example connector#151
dijimsta merged 2 commits into
mainfrom
extract-accounts-data-connector

Conversation

@dijimsta

@dijimsta dijimsta commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Splits the Account/AccountContact queries and mutations out of the example Data Connect connector into a new accounts connector, generating a dedicated accounts-data-connector-admin admin SDK package.
  • Works around a firebase-admin bug where getDataConnect() caches DataConnect instances keyed only by location/serviceId, ignoring the connector name — once functions called two connectors sharing one service in the same process, calls started silently routing to the wrong connector (operation "X" not found). Fixed upstream in firebase/firebase-admin-node#3055; until a release with that fix ships, functions/plaster-calculator-functions/src/data-connect.ts constructs one DataConnect instance per connector directly instead of relying on the shared cache.

Test plan

  • pnpm build, pnpm lint, pnpm format all pass
  • Reproduced the cache-collision bug directly against the Data Connect emulator, confirmed the fix resolves it
  • Ran the real createAccountlistProjectsByAccount sequence end-to-end against the emulator and confirmed it now succeeds
  • Manually verify the account detail page (/app/accounts/:id) loads correctly in the running app

🤖 Generated with Claude Code

dijimsta and others added 2 commits July 6, 2026 22:24
Splits the Account/AccountContact queries and mutations out of the example
connector into a new accounts connector, generating a dedicated
accounts-data-connector-admin admin SDK package for functions.

Also works around a firebase-admin bug (getDataConnect caches DataConnect
instances by location/serviceId only, ignoring the connector), which the
functions code now hits since it calls two connectors sharing one service in
the same process. Fixed upstream in
firebase/firebase-admin-node#3055; until a release
with that fix is out, functions construct their own DataConnect instance per
connector instead of relying on the shared cache.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Re-running the SDK generator reordered the generated function declarations;
no functional change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dijimsta dijimsta enabled auto-merge (squash) July 6, 2026 12:28
@dijimsta dijimsta merged commit cd27d78 into main Jul 6, 2026
7 checks passed
@dijimsta dijimsta deleted the extract-accounts-data-connector branch July 6, 2026 12:30
dijimsta added a commit that referenced this pull request Jul 6, 2026
)

Consolidates the accounts, example, and questionnaires Firebase Data
Connect connectors into one connector at data/connector, generating
combined @generated/data-connector-admin and @generated/data-connector-web
(with a react subpackage) SDKs. As a result, account operations are now
also available through the web SDK, alongside questionnaires.

Operations are split into domain-scoped .gql files (accounts, projects,
quotes, reminders, users, questionnaires) within the single connector, and
the UserSettings type moves from data/schemas/accounts.gql into its own
data/schemas/users.gql to match.

Since there is only one connector now, the getDataConnect() caching
workaround added in #151 (constructing a DataConnect instance per
connector to dodge firebase-admin's location/serviceId-keyed cache) is no
longer needed, so functions/plaster-calculator-functions/src/data-connect.ts
is removed; call sites let the generated functions resolve the connector
implicitly. Generated-SDK imports across functions, apps, and libraries now
use `import * as DataConnector` namespace imports instead of aliased named
imports, avoiding renames like `createAccount as dcCreateAccount`.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant