Skip to content

feat: add Query.relationship helper - #1903

Open
abnegate wants to merge 1 commit into
mainfrom
feat/query-relationship
Open

feat: add Query.relationship helper#1903
abnegate wants to merge 1 commit into
mainfrom
feat/query-relationship

Conversation

@abnegate

Copy link
Copy Markdown
Member

Summary

Adds Query.relationship to generated SDKs so clients can constrain populated related documents.

Query.relationship('comments', [
    Query.equal('approved', true),
    Query.orderDesc('$createdAt'),
    Query.limit(25),
])

This matches Query::relationship() / TYPE_RELATIONSHIP in utopia-php/database#968.

The helper takes a relationship attribute and inner queries (filters, order, select, pagination), then serializes them as nested query objects — the same shape as Query.elemMatch.

Languages

PHP, Web/Node, Deno, React Native, Dart/Flutter, Python, Ruby, Kotlin/Android, .NET/Unity, Swift/Apple, Go, Rust.

Skills docs include the new helper.

Test plan

  • Generated PHP Query::relationship unit test (8 assertions)
  • Generated PHP Pint
  • Generated Go gofmt
  • E2E query-helper expectation added for every language that already tests elemMatch
  • CI on this PR

Expose relationship queries on generated Query classes so SDKs can
constrain populated related documents the same way as Query::relationship
in utopia-php/database.
@greptile-apps

greptile-apps Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the new helper is consistently implemented and tested across the affected SDK targets.

Summary

  • Serializes nested filters, ordering, selection, and pagination queries for populated relationship attributes.
  • Adds generated unit coverage and cross-language E2E contract expectations.
  • Updates skills documentation for supported language families.

Reviews (1) · Last reviewed commit: "feat: add Query.relationship helper"

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