Open
Conversation
Surface TableMeta from buildSchemaWithMeta() through database, pgpm-module, and endpoint sources. Endpoint fires _meta query in parallel with introspection and falls back gracefully. Extract shared executeGraphqlRequest() core.
… heuristic Add enrichRelationsFromMeta (authoritative path) and enrichRelationsFromCrossReference (SDL fallback) to infer-tables. Extend CleanManyToManyRelation with junction FK fields. Add TableMetaInput interface for structural decoupling from graphile-misc-plugins.
- Extract shared junction-utils module (collectJunctionMutations, resolveJunctionInfo, getJunctionHookName) - Generate React Query mutation hooks for add/remove junction operations (usePostAddTagMutation etc.) - Bidirectional onSuccess invalidation: detail+lists on both left and right entities - Add M:N entries to mutation-keys factory and invalidation helpers - Update barrel generators with junction hook exports and dedup - Shared M:N test fixtures, 5 new hook tests, 3 new key/invalidation tests
- Generate ToMany filter interfaces (every/some/none) for hasMany relations
- Add relational filter fields on XxxFilter types (belongsTo, hasOne, hasMany)
- M:N excluded from filter types (PostGraphile connection-filter doesn't support direct M:N)
- Generate static `filters` property on model classes with ergonomic helpers:
- belongsTo/hasOne: Post.filters.hasAuthor(filter)
- hasMany: User.filters.hasPost/hasEveryPost/hasNoPost(filter)
- M:N via junction path: Post.filters.hasTag(filter) => { postTags: { some: { tag: filter } } }
- Extract resolveJunctionFilterPath helper, FILTER_QUANTIFIERS const, Map-based lookups
- 16 new tests covering all relation types, null fieldNames, junction path resolution
- Prioritize getRelations() method over .relations property - Add pgRelations registry fallback for resources lacking getRelations() - Change isReferencee guard from !== false to === true (PGv5 leaves undefined) - Add after: PgManyToManyRelationPlugin to ensure M:N Map is populated
- Junction table with isReferencee undefined (real PGv5 behavior) - Mixed isReferencee values (true/false/undefined) on same resource - Registry-based fallback when resource lacks getRelations() - Full M:N + junction belongsTo integration scenario
Use resolveTableType() instead of raw codec.name for belongsTo references, referencedBy, rightTable, junctionTable, and FK referencedTable fields.
Now that _meta emits consistent inflected PascalCase names for all relation targets, the multi-step fuzzy matching is unnecessary.
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.
No description provided.