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

[5.x]: Float numbers in GraphQL weird behaviour #15222

Closed
ishetnogferre opened this issue Jun 18, 2024 · 1 comment
Closed

[5.x]: Float numbers in GraphQL weird behaviour #15222

ishetnogferre opened this issue Jun 18, 2024 · 1 comment
Assignees
Labels

Comments

@ishetnogferre
Copy link

What happened?

Description

We're using the number fields to store longitude and latitude because we only need these values. In the front-end we us GraphQL to query between two numbers.

Steps to reproduce

  1. Have a Numbers field, set to 16-20 decimals
  2. Query the exact number
  3. Query between 2 numbers with decimals

Expected behavior

In case 2: have the exact entry returned
In case 3: have the entry and others returned

Actual behavior

  1. When using the exact number, an error show we can only use string, integer or boolean.
    Screenshot 2024-06-18 at 10 29 27
Screenshot 2024-06-18 at 10 29 20
  1. When using a simple comparison (>= or <=), it show the correct entry and more
Screenshot 2024-06-18 at 10 30 47
  1. When using a range, it shows none
Screenshot 2024-06-18 at 10 30 58

Extra
Don't know if this is expected behaviour but the filter input doesn't incorporate the decimal setting from the Number field.
Screenshot 2024-06-18 at 10 39 56

Craft CMS version

Craft 5.2.0

PHP version

8.2

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@brandonkelly
Copy link
Member

Thanks for reporting those! Craft 4.10.2 and 5.2.2 are out with a fix for the condition rule bug (6b370d3) and 5.2.2 also includes a fix for the query param handling (#15227).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants