Skip to content

fix: QueryHook does not check that top-level load attributes belong to the hooked model #388

Closed

Description

@gazorby

Found while reviewing #386.

QueryHook checks that nested load attributes belong to their parent relationship's model (#382), but top-level attributes cannot be checked at construction: the hook's model is only a generic parameter. A hook on Color with load=[User.group] builds, then fails at query time when group is looked up on the Color alias. A foreign column whose key also exists on the hook's model silently loads that model's column instead.

Expected

Top-level load attributes are checked against the model once the hook is bound to its field or type (the model is known there), raising QueryHookError with the same message style as nested attributes.

Activity

  1. added a commit that references this issue on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions