Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Query syntax problems with TypeBox 0.26 #3182

Copy link
Copy link
@daffl

Description

@daffl
Issue body actions

The query syntax helper creates two different types between TypeBox 0.25:

Screenshot_2023-04-20_at_20 46 18

And 0.26:

Screenshot_2023-04-20_at_20 51 28

While the local package tests are passing, in a generated app this means that any operator like

app.service('messages').find({
  query: {
    createdAt: {
      $gte: Date.now() - 24 * 60 * 60 * 1000
    }
  }
})

Will receive a TypeScript error like this:

Property '$something' is incompatible with index signature.
          Type '<type>' is not assignable to type 'never'.

The current solution is to revert to TypeBox 0.25 and probably add a better integration like

Type.QuerySyntax(queryProperties, ['text', 'id'])

To v5.1

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.