JSPM

postgraphile-postgis-wkt

0.1.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q33440F
  • License MIT

Package Exports

  • postgraphile-postgis-wkt
  • postgraphile-postgis-wkt/package.json

Readme

Very Simple WKT only PostGIS plugin

Example Table and Queries

using a table named simple with two columns, column1 and geolocation, geolocation of type public.geography(point, 4326)

CREATE TABLE public."simple" (
    column1 varchar NULL,
    geolocation public.geography(point, 4326) NULL,
);

Example Query

query {
  allSimples(first: 1) {
    edges {
      node {
        column1
        geolocation
      }
    }
  }
}

Result:

{
  "data": {
    "allSimples": {
      "edges": [
        {
          "node": {
            "column1": "Some Field In Eugene",
            "geolocation": "POINT(-123 40)"
          }
        }
      ]
    }
  }
}

Example Mutation


mutation {
  createSimple(input: {
    simple: {
      column1: "Eiffel Tower",
      geolocation: "POINT(2.351400 48.857500)"
    }
  }) {
    simple {
      column1
      geolocation
    }
  }
}

Result:

{
  "data": {
    "createSimple": {
      "simple": {
        "column1": "Eiffel Tower",
        "geolocation": "POINT(2.3514 48.8575)"
      }
    }
  }
}

Example Code

Navigate to the example directory, run npm install then npm run dev, that will listen at http://localhost:5050