Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime mismatch between mapData result and validate input in createQuery #490

Open
evist0 opened this issue Jun 26, 2024 · 0 comments
Open
Labels
scope:core type:bug Something isn't working
Milestone

Comments

@evist0
Copy link

evist0 commented Jun 26, 2024

Description

There is a bug in the createQuery function where the validate function's argument type correctly inherits the result of mapData type-wise, but the actual runtime values do not match, causing validation issues.

Steps to Reproduce

  1. Open the provided reproduction link.
  2. Check the model.ts file where query is implemented.
  3. Observe that while TypeScript shows no type errors, the runtime behavior indicates a mismatch between the mapData result and the validate input.

Expected Behavior

The validate function should receive the correctly mapped data from mapData at runtime, ensuring proper validation.

Alternatively, if validation is intended to occur before mapData, the overload types should be adjusted accordingly to reflect this order of operations.

Actual Behavior

Despite TypeScript showing no type errors, the validate function receives data that doesn't match the expected runtime values from mapData, leading to validation failures.

@igorkamyshev igorkamyshev added type:bug Something isn't working scope:core labels Jul 16, 2024
@igorkamyshev igorkamyshev added this to the v1.0 milestone Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:core type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants