Skip to content

Commit 66684d7

Browse files
committed
gatsby v3 compatibility
1 parent 72d1365 commit 66684d7

File tree

6 files changed

+3716
-4601
lines changed

6 files changed

+3716
-4601
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# v2.0.0
2+
3+
## Feat: Gatsby v3 compatibility
4+
5+
**No breaking changes**. Just a version bump and minor tweaks required for `gatsby@^3.0.0` compatibility.
6+
17
# v1.0.0
28

39
## Feat: writeCompiledQueries utility

package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,15 @@
3030
"@types/fs-extra": "^9.0.1",
3131
"@types/jest": "^26.0.7",
3232
"@types/node": "^14.0.25",
33-
"gatsby": "^2.23.12",
34-
"graphql": "^14.6.0",
33+
"gatsby": "~3.3.0",
34+
"graphql": "^15.4.0",
3535
"jest": "^26.1.0",
3636
"react-dom": "^16.13.1",
3737
"rimraf": "^3.0.2",
3838
"ts-jest": "^26.1.3",
3939
"typescript": "^3.9.7"
4040
},
4141
"peerDependencies": {
42-
"gatsby": "^2.0.15",
43-
"graphql": "^14.0.0 || ^15.0.0"
42+
"gatsby": "^3.0.0"
4443
}
4544
}

src/source-nodes/node-actions/delete-nodes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function deleteNodes(
1515
)
1616
const node = context.gatsbyApi.getNode(id)
1717
if (node) {
18-
context.gatsbyApi.actions.deleteNode({ node })
18+
context.gatsbyApi.actions.deleteNode(node)
1919
}
2020
// TODO: find all nodes referencing deleted nodes and update/refetch all of them?
2121
// Alternatively - soft-delete:

src/source-nodes/node-actions/touch-nodes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function touchNodesByType(
2323

2424
for (const node of nodes) {
2525
if (!excludeIds.has(node.id)) {
26-
actions.touchNode({ nodeId: node.id })
26+
actions.touchNode(node)
2727
}
2828
}
2929
}

src/types.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Node, NodePluginArgs } from "gatsby"
2-
import { ComposeFieldConfig } from "graphql-compose"
2+
import { ObjectTypeComposerFieldConfigDefinition } from "graphql-compose"
33
import {
44
DocumentNode,
55
ExecutionResult,
@@ -177,5 +177,7 @@ interface IGatsbyFieldTransformArgs {
177177

178178
export interface IGatsbyFieldTransform {
179179
test: (args: IGatsbyFieldTransformArgs) => boolean
180-
transform: (args: IGatsbyFieldTransformArgs) => ComposeFieldConfig<any, any>
180+
transform: (
181+
args: IGatsbyFieldTransformArgs
182+
) => ObjectTypeComposerFieldConfigDefinition<any, any>
181183
}

0 commit comments

Comments
 (0)