Account/instance domain model fields, Relay connections, and GraphQL tests#18
Open
dahlia wants to merge 5 commits into
Open
Account/instance domain model fields, Relay connections, and GraphQL tests#18dahlia wants to merge 5 commits into
dahlia wants to merge 5 commits into
Conversation
- Add `name` column to accounts table with a CHECK constraint ensuring non-empty names - Add `accepted` timestamp to instance_members table to distinguish accepted members from invited (pending) ones - Add partial indexes on instance_members for efficient lookups of accepted members - Add filtered instanceMembers relations on both accounts and instances with `accepted IS NOT NULL` condition - Add `instances` GraphQL connection on Account and `members` GraphQL connection on Instance, both filtering by accepted status - Expose `name` field on Account and `slug` field on Instance in GraphQL The instance_members junction table now tracks both invited and accepted members. The `accepted` field is NULL for pending invitations. Partial indexes on (accountId) and (instanceId) with `accepted IS NOT NULL` optimize queries for active memberships.
Add a test-only helper that runs callbacks with a fresh migrated PGlite database for GraphQL package tests. Cover the helper with a smoke test that verifies migrated tables are queryable. Move shared database-related package versions into the pnpm catalog so workspace packages can use the same PGlite, pg, and @types/pg versions. Assisted-by: Codex:gpt-5.5
Add a test harness that builds a Yoga server on top of the temporary migrated database helper. The harness exposes the database, Yoga server, bound fetch function, and a JSON POST helper for GraphQL tests. Cover the harness with a smoke test that posts a simple operation through the Yoga server. Assisted-by: Codex:gpt-5.5
Add GraphQL tests for accountByUuid, Account.instances, and Instance.members using the temporary Yoga test harness. The tests seed accepted and pending memberships to verify connection results only include accepted relationships. Assisted-by: Codex:gpt-5.5
Add admin flags to accounts and instance memberships, with the corresponding Drizzle migration. Define account and instance membership connections through Drizzle connection helpers so their edges can expose membership metadata. The connections now include created, accepted, and admin fields while keeping accepted-only filtering and totalCount behavior. Assisted-by: Codex:gpt-5.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nameandadminfields to theaccountstable; addadminandacceptedfields to theinstance_memberstable, treatingNULLas a pending invitation. Generate the corresponding migrations under packages/models/drizzle.nameandadminon theAccountGraphQL type; exposeuuidon bothAccountandInstance.instancesconnection onAccountandmembersconnection onInstance, both withtotalCountand per-edge metadata (created,accepted,admin). Only accepted members appear in either connection.accountIdandinstanceId) that cover only accepted rows.AccountandInstanceGraphQL fields and connections in packages/graphql/src/account.test.ts and packages/graphql/src/instance.test.ts.Test code in packages/graphql/src/account.test.ts, packages/graphql/src/instance.test.ts, packages/graphql/src/harness.test.ts, and packages/graphql/src/harness-smoke.test.ts was written with assistance from Codex (GPT-5.5). All other changes were written without AI assistance. The AI-assisted test code has been manually reviewed and verified.