ChilliCream / ChilliCream/graphql-platform

UseQuery<T> reevaluated on all page events

Open
#6,365 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ strawberry shake
Dominant language
C#
Stars
5.8k
Forks
810
Avg merge
15h 39m
Merged PRs (30d)
98

Description

Is there an existing issue for this?
  • I have searched the existing issues
Product

Strawberry Shake

Describe the bug

I have on a page a UseQuery<T> derived component - in my case, UseAddressTypes returning a list of AddressType entities. A component displaying the results is bound to the results of UseAddressTypes. All EventCallbacks on this page, whether inside the UseAddressTypes hierarchy or not, trigger the query again.
The smallest reproduction of the issue is below.

The expected behavior would be for the UseAddressTypes query to be triggered again if any of the subscribed properties change, as specified in the generated code in the component

Subscribe(Operation.Watch(Skip, Take, Where, Order, strategy: Strategy));
Steps to reproduce
<UseAddressTypes Order="new AddressTypeDtoSortInput[] { new AddressTypeDtoSortInput() { Id = SortEnumType.Asc }}"></UseAddressTypes>
<button @onclick="Click">click</button>

@code {
    private void Click()
    {
    }
}

Clicking the button triggers the UseAddressTypes query again

Relevant log output

No response

Additional Context?

No response

Version

13.3.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the smallest reproduction in the issue: a UseAddressTypes component with the Order parameter and an otherwise empty button callback. Trace the generated Subscribe(Operation.Watch(Skip, Take, Where, strategy: Strategy)) behavior and verify that clicking the button no longer reruns the query unless a subscribed property changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.