Skip to content

filter returns empty result (possible issue with SRID) #15

Open
@andilabs

Description

image

the postgraphile query:

query findNearby($point: GeoJSON) {
      allApiDjtinderusers (
        filter: {
          lastLocation: { equals: $point }
        }) {
        nodes {
          id
          lastLocation {
        		geojson
        		srid
        		y
        		x
      		}
        }
      }
    }

the variable:

{
  "point": {
    "type":"Point",
    "coordinates":[20.9800552409116,52.2724808126503],
    "crs": {"type": "name", "properties": {"name": "EPSG:4326"}}

  }
}

the result:

{
  "data": {
    "allApiDjtinderusers": {
      "nodes": []
    }
  }
}

There exist record with given 20.9800552409116,52.2724808126503 coordinates, so I would expect getting it in result of equals query.

Additional info for reference:

the postgres table:

postgres=# \d api_djtinderuser+
                                         Table "public.api_djtinderuser"
      Column       |          Type          | Collation | Nullable |                   Default
-------------------+------------------------+-----------+----------+----------------------------------------------
 id                | integer                |           | not null | nextval('api_djtinderuser_id_seq'::regclass)
 last_location     | geometry(Point,4326)   |           |          |

Indexes:
    "api_djtinderuser_pkey" PRIMARY KEY, btree (id)
    "api_djtinderuser_last_location_id" gist (last_location)

PG version:

postgres=# SELECT version();
                                                             version
----------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 11.2 (Debian 11.2-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
(1 row)

POSTGIS version:

postgres=# \dx
                                     List of installed extensions
  Name   | Version |   Schema   |                             Description
---------+---------+------------+---------------------------------------------------------------------
 plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
 postgis | 2.5.2   | public     | PostGIS geometry, geography, and raster spatial types and functions
(2 rows)

graphile

inside the graphql container I installed following npm packages:

RUN npm install -g postgraphile
RUN npm install -g @graphile/postgis
RUN npm install -g postgraphile-plugin-connection-filter
RUN npm install -g postgraphile-plugin-connection-filter-postgis

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions