Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
73d9987
Upgrade dependencies to v5
FelixZY Jun 3, 2024
b150a86
Specify `testEnvironment: jest-environment-node` in jest.config.js
FelixZY Jun 3, 2024
e90b32b
Set `moduleResolution: NodeNext`
FelixZY Jun 3, 2024
0ccde26
Remove dependency on `postgraphile-core`
FelixZY Jun 4, 2024
9caf046
Rename `PostgisPlugin` -> `PostgisPreset`
FelixZY Jun 4, 2024
6133b89
Switch to using @tsconfig/node20
benjie Jun 12, 2024
91d8b15
More dependency updates and fixes
benjie Jun 12, 2024
2f0e155
Separate build file
benjie Jun 12, 2024
55302eb
Reconfigure tsc
benjie Jun 12, 2024
2284efe
Change how a schema is loaded in the tests
benjie Jun 12, 2024
6dd834c
Upgrade prettier
benjie Jun 12, 2024
8c1d4d4
Tweak tsconfigs
benjie Jun 12, 2024
733da29
Lint
benjie Jun 12, 2024
d6dc500
Start looking at porting a plugin
benjie Jun 12, 2024
7dbdf7b
Continue v5 migration
dargmuesli Feb 15, 2026
9e8dd58
Merge branch 'main' into fzy/v5/dargmuesli
dargmuesli Feb 16, 2026
a311f06
feat: implement feedback
dargmuesli Feb 16, 2026
18b5109
Rework types
dargmuesli Feb 16, 2026
a312544
Add postversion script
dargmuesli Feb 16, 2026
aa3e6e3
Set ESM
dargmuesli Feb 17, 2026
961b3d8
Include file extension for imports
dargmuesli Feb 17, 2026
25b9a29
Correct srid and geojson
dargmuesli Feb 24, 2026
ac995a3
Fix geojson test
dargmuesli Feb 24, 2026
1ffb3bf
Merge upstream/main into fzy/v5/dargmuesli
dargmuesli Jul 27, 2026
b78008e
Add prepare script so git-based installs build dist/
dargmuesli Jul 27, 2026
b65f53f
fix: correct mutation field reads and GeoJSON input for geometry/geog…
dargmuesli Jul 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
node_modules
*.tsbuildinfo
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
export default {
trailingComma: "es5"
}
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ have specific needs please get in touch!

## Usage

This plugin requires PostGraphile **v4.4.0** or higher to function correctly.
This plugin requires PostGraphile **v5.0.0-rc.6** or higher to function correctly.

Add PostGIS to your database:

Expand All @@ -43,8 +43,18 @@ CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;

Load the plugin:

```
postgraphile --append-plugins @graphile/postgis
```ts
import { PostgisPreset } from "@graphile/postgis";

const preset: GraphileConfig.Preset = {
extends: [
// ... Amber/V4/etc presets
PostgisPreset,
],
// ...
};

export default preset;
```

#### Querying and mutating
Expand Down
66 changes: 7 additions & 59 deletions __tests__/__snapshots__/schema.minimal_dimensional.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`prints a schema with this plugin 1`] = `
"""All input for the create \`Foo\` mutation."""
Expand Down Expand Up @@ -27,7 +27,7 @@ type CreateFooPayload {
"""An edge for our \`Foo\`. May be used by Relay 1."""
fooEdge(
"""The method to use when ordering \`Foo\`."""
orderBy: [FoosOrderBy!] = [PRIMARY_KEY_ASC]
orderBy: [FoosOrderBy!]! = [PRIMARY_KEY_ASC]
): FoosEdge

"""
Expand Down Expand Up @@ -78,7 +78,7 @@ type DeleteFooPayload {
"""An edge for our \`Foo\`. May be used by Relay 1."""
fooEdge(
"""The method to use when ordering \`Foo\`."""
orderBy: [FoosOrderBy!] = [PRIMARY_KEY_ASC]
orderBy: [FoosOrderBy!]! = [PRIMARY_KEY_ASC]
): FoosEdge

"""
Expand Down Expand Up @@ -125,7 +125,7 @@ type FoosConnection {
"""
A list of edges which contains the \`Foo\` and cursor to aid in pagination.
"""
edges: [FoosEdge!]!
edges: [FoosEdge]!

"""A list of \`Foo\` objects."""
nodes: [Foo]!
Expand Down Expand Up @@ -171,59 +171,6 @@ interface GeometryGeometry {
srid: Int!
}

type GeometryGeometryCollection implements GeometryGeometry & GeometryInterface {
geojson: GeoJSON
geometries: [GeometryGeometry]
srid: Int!
}

"""All geometry types implement this interface"""
interface GeometryInterface {
"""Converts the object to GeoJSON"""
geojson: GeoJSON

"""Spatial reference identifier (SRID)"""
srid: Int!
}

type GeometryLineString implements GeometryGeometry & GeometryInterface {
geojson: GeoJSON
points: [GeometryPoint]
srid: Int!
}

type GeometryMultiLineString implements GeometryGeometry & GeometryInterface {
geojson: GeoJSON
lines: [GeometryLineString]
srid: Int!
}

type GeometryMultiPoint implements GeometryGeometry & GeometryInterface {
geojson: GeoJSON
points: [GeometryPoint]
srid: Int!
}

type GeometryMultiPolygon implements GeometryGeometry & GeometryInterface {
geojson: GeoJSON
polygons: [GeometryPolygon]
srid: Int!
}

type GeometryPoint implements GeometryGeometry & GeometryInterface {
geojson: GeoJSON
srid: Int!
x: Float!
y: Float!
}

type GeometryPolygon implements GeometryGeometry & GeometryInterface {
exterior: GeometryLineString
geojson: GeoJSON
interiors: [GeometryLineString]
srid: Int!
}

"""
The root mutation type which contains root level fields which mutate data.
"""
Expand Down Expand Up @@ -328,6 +275,8 @@ type Query implements Node {
"""The globally unique \`ID\` to be used in selecting a single \`Foo\`."""
nodeId: ID!
): Foo

"""Get a single \`Foo\`."""
fooById(id: Int!): Foo

"""Fetches an object given its globally unique \`ID\`."""
Expand Down Expand Up @@ -396,13 +345,12 @@ type UpdateFooPayload {
"""An edge for our \`Foo\`. May be used by Relay 1."""
fooEdge(
"""The method to use when ordering \`Foo\`."""
orderBy: [FoosOrderBy!] = [PRIMARY_KEY_ASC]
orderBy: [FoosOrderBy!]! = [PRIMARY_KEY_ASC]
): FoosEdge

"""
Our root query field type. Allows us to run any query from our mutation payload.
"""
query: Query
}

`;
13 changes: 7 additions & 6 deletions __tests__/__snapshots__/schema.minimal_type.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`prints a schema with this plugin 1`] = `
"""All input for the create \`Foo\` mutation."""
Expand Down Expand Up @@ -27,7 +27,7 @@ type CreateFooPayload {
"""An edge for our \`Foo\`. May be used by Relay 1."""
fooEdge(
"""The method to use when ordering \`Foo\`."""
orderBy: [FoosOrderBy!] = [PRIMARY_KEY_ASC]
orderBy: [FoosOrderBy!]! = [PRIMARY_KEY_ASC]
): FoosEdge

"""
Expand Down Expand Up @@ -78,7 +78,7 @@ type DeleteFooPayload {
"""An edge for our \`Foo\`. May be used by Relay 1."""
fooEdge(
"""The method to use when ordering \`Foo\`."""
orderBy: [FoosOrderBy!] = [PRIMARY_KEY_ASC]
orderBy: [FoosOrderBy!]! = [PRIMARY_KEY_ASC]
): FoosEdge

"""
Expand Down Expand Up @@ -125,7 +125,7 @@ type FoosConnection {
"""
A list of edges which contains the \`Foo\` and cursor to aid in pagination.
"""
edges: [FoosEdge!]!
edges: [FoosEdge]!

"""A list of \`Foo\` objects."""
nodes: [Foo]!
Expand Down Expand Up @@ -291,6 +291,8 @@ type Query implements Node {
"""The globally unique \`ID\` to be used in selecting a single \`Foo\`."""
nodeId: ID!
): Foo

"""Get a single \`Foo\`."""
fooById(id: Int!): Foo

"""Fetches an object given its globally unique \`ID\`."""
Expand Down Expand Up @@ -359,13 +361,12 @@ type UpdateFooPayload {
"""An edge for our \`Foo\`. May be used by Relay 1."""
fooEdge(
"""The method to use when ordering \`Foo\`."""
orderBy: [FoosOrderBy!] = [PRIMARY_KEY_ASC]
orderBy: [FoosOrderBy!]! = [PRIMARY_KEY_ASC]
): FoosEdge

"""
Our root query field type. Allows us to run any query from our mutation payload.
"""
query: Query
}

`;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`prints a schema with this plugin 1`] = `
"""All input for the create \`Foo\` mutation."""
Expand Down Expand Up @@ -27,7 +27,7 @@ type CreateFooPayload {
"""An edge for our \`Foo\`. May be used by Relay 1."""
fooEdge(
"""The method to use when ordering \`Foo\`."""
orderBy: [FoosOrderBy!] = [PRIMARY_KEY_ASC]
orderBy: [FoosOrderBy!]! = [PRIMARY_KEY_ASC]
): FoosEdge

"""
Expand Down Expand Up @@ -78,7 +78,7 @@ type DeleteFooPayload {
"""An edge for our \`Foo\`. May be used by Relay 1."""
fooEdge(
"""The method to use when ordering \`Foo\`."""
orderBy: [FoosOrderBy!] = [PRIMARY_KEY_ASC]
orderBy: [FoosOrderBy!]! = [PRIMARY_KEY_ASC]
): FoosEdge

"""
Expand Down Expand Up @@ -125,7 +125,7 @@ type FoosConnection {
"""
A list of edges which contains the \`Foo\` and cursor to aid in pagination.
"""
edges: [FoosEdge!]!
edges: [FoosEdge]!

"""A list of \`Foo\` objects."""
nodes: [Foo]!
Expand Down Expand Up @@ -291,6 +291,8 @@ type Query implements Node {
"""The globally unique \`ID\` to be used in selecting a single \`Foo\`."""
nodeId: ID!
): Foo

"""Get a single \`Foo\`."""
fooById(id: Int!): Foo

"""Fetches an object given its globally unique \`ID\`."""
Expand Down Expand Up @@ -359,13 +361,12 @@ type UpdateFooPayload {
"""An edge for our \`Foo\`. May be used by Relay 1."""
fooEdge(
"""The method to use when ordering \`Foo\`."""
orderBy: [FoosOrderBy!] = [PRIMARY_KEY_ASC]
orderBy: [FoosOrderBy!]! = [PRIMARY_KEY_ASC]
): FoosEdge

"""
Our root query field type. Allows us to run any query from our mutation payload.
"""
query: Query
}

`;
Loading