Skip to content

[Potential] TS Query builder is not Idempotent; Calling build() multiple times does not yield the same result #277

@max-scopp

Description

@max-scopp

Version

=2.1.0

Details

If you create a query twice from the same class instance in the ts gridify client, filters such as "filter name by contains abc" are created twice.

E.g.

  queryOptions: (queryBuilder) => {
                return {
                    queryKey: ['demo', queryBuilder.build()], // all fine here
                    queryFn: () => {
                        console.log('query', queryBuilder.build()); // all filters are applied twice
                    },
                };
            },

NOTE: Created ticket for my own peace, I'll investigate further when I got the time for it.

Steps to reproduce

Call any instance twice or more and observe subsequent return values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggridify-clientIssues related to the TypeScript client

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions