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

Searching map field via GraphQL with invalid location search criteria returns all results #277

Closed
jpcarpenter opened this issue Oct 7, 2020 · 0 comments

Comments

@jpcarpenter
Copy link

Description

All entries within a section are returned when searching a map field via GraphQL with an invalid location search criteria.

Steps to reproduce

  1. Create a query within the GraphiQL interface.
query ($address: [QueryArgument]) {
  nearestLocation: entries(address: $address, section: "locationEntries", orderBy: "distance") {
    ... on locationEntries_locationEntries_Entry {
      id
      title
      address {
        lat
        lng
        zoom
        distance
        address
        parts {
          address
          city
          postcode
          state
        }
      }
    }
  }
}
  1. Create a query variable with invalid data that should not return any results.
{
  "address": "{\"location\":\"this shouldn't return anything\",\"radius\":100,\"unit\":\"mi\",\"country\":\"US\"}"
}
  1. Run the query and see all entries within the queried section returned.

Additional info

  • Craft version: Craft CMS 3.5.12.1
  • Maps version: Maps (lite) 3.8.4.1
  • PHP version: 7.3.22
  • Database driver & version: MySQL 5.7.31
@Tam Tam closed this as completed in 3c21a67 Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant