Skip to content

Commit e917fc3

Browse files
authored
chore: Update devDeps (#78)
1 parent 27651ef commit e917fc3

16 files changed

+5497
-7244
lines changed

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"test": "jest",
1111
"build": "rimraf dist/* && tsc",
1212
"prepublishOnly": "npm run build",
13+
"typecheck": "tsc --noEmit",
1314
"format": "prettier --list-different --write ./src"
1415
},
1516
"files": [
@@ -27,16 +28,16 @@
2728
"p-queue": "^6.4.0"
2829
},
2930
"devDependencies": {
30-
"@types/fs-extra": "^9.0.1",
31-
"@types/jest": "^26.0.7",
32-
"@types/node": "^14.0.25",
33-
"gatsby": "~3.3.0",
34-
"graphql": "^15.4.0",
35-
"jest": "^26.1.0",
36-
"react-dom": "^16.13.1",
31+
"@types/fs-extra": "^9.0.13",
32+
"@types/jest": "^29.2.3",
33+
"@types/node": "^18.11.9",
34+
"gatsby": "^5.1.0",
35+
"graphql": "^16.6.0",
36+
"jest": "^29.3.1",
37+
"react-dom": "^18.2.0",
3738
"rimraf": "^3.0.2",
38-
"ts-jest": "^26.1.3",
39-
"typescript": "^3.9.7"
39+
"ts-jest": "^29.0.3",
40+
"typescript": "^4.9.3"
4041
},
4142
"peerDependencies": {
4243
"gatsby": "^3.0.0 || ^4.0.0 || ^5.0.0"

src/compile-node-queries/analyze/build-type-usages-map.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
TypeInfo,
77
visit,
88
visitWithTypeInfo,
9+
Kind,
910
} from "graphql"
1011
import { IGatsbyNodeConfig, RemoteTypeName } from "../../types"
1112

@@ -57,7 +58,7 @@ export function buildTypeUsagesMap(
5758
args: IBuildTypeUsagesMapArgs
5859
): TypeUsagesMap {
5960
const fullDocument: DocumentNode = {
60-
kind: "Document",
61+
kind: Kind.DOCUMENT,
6162
definitions: args.fragments,
6263
}
6364

src/compile-node-queries/ast-transformers/add-node-fragment-spreads-and-typename.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import {
2-
ASTKindToNode,
32
FragmentDefinitionNode,
43
SelectionNode,
5-
Visitor,
4+
ASTVisitor,
65
} from "graphql"
76
import * as GraphQLAST from "../../utils/ast-nodes"
87
import { isFragmentSpread } from "../../utils/ast-predicates"
98

109
export function addNodeFragmentSpreadsAndTypename(
1110
nodeFragments: FragmentDefinitionNode[]
12-
): Visitor<ASTKindToNode> {
11+
): ASTVisitor {
1312
return {
1413
FragmentDefinition: () => false,
1514
SelectionSet: node => {

src/compile-node-queries/ast-transformers/add-remote-typename-field.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
TypeInfo,
3-
Visitor,
4-
ASTKindToNode,
3+
ASTVisitor,
54
SelectionSetNode,
65
isCompositeType,
76
getNamedType,
@@ -30,7 +29,7 @@ interface IAddTypeNameArgs {
3029
*/
3130
export function addRemoteTypeNameField({
3231
typeInfo,
33-
}: IAddTypeNameArgs): Visitor<ASTKindToNode> {
32+
}: IAddTypeNameArgs): ASTVisitor {
3433
return {
3534
SelectionSet: (node, _, parent) => {
3635
const type = typeInfo.getType()

src/compile-node-queries/ast-transformers/add-variable-definitions.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import {
2-
Visitor,
3-
ASTKindToNode,
2+
ASTVisitor,
43
OperationDefinitionNode,
54
VariableDefinitionNode,
65
TypeInfo,
76
GraphQLInputType,
87
DocumentNode,
98
parseType,
9+
Kind,
1010
} from "graphql"
1111
import * as GraphQLAST from "../../utils/ast-nodes"
1212

@@ -23,7 +23,7 @@ interface DefinitionInfo {
2323

2424
export function addVariableDefinitions({
2525
typeInfo,
26-
}: IAddVariableDefinitionsArgs): Visitor<ASTKindToNode> {
26+
}: IAddVariableDefinitionsArgs): ASTVisitor {
2727
const fragmentInfo = new Map<string, DefinitionInfo>()
2828
const operationInfo = new Map<string, DefinitionInfo>()
2929

@@ -91,9 +91,9 @@ function ensureVariableDefinitions(
9191
const variableDefinitions: VariableDefinitionNode[] = []
9292
for (const [name, inputType] of variables) {
9393
variableDefinitions.push({
94-
kind: "VariableDefinition",
94+
kind: Kind.VARIABLE_DEFINITION,
9595
variable: {
96-
kind: "Variable",
96+
kind: Kind.VARIABLE,
9797
name: GraphQLAST.name(name),
9898
},
9999
type: parseType(inputType.toString()),

src/compile-node-queries/ast-transformers/alias-gatsby-node-fields.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import {
22
FieldNode,
3-
Visitor,
3+
ASTVisitor,
44
TypeInfo,
5-
ASTKindToNode,
65
GraphQLSchema,
76
GraphQLCompositeType,
87
isObjectType,
@@ -24,7 +23,7 @@ interface IAliasGatsbyNodeFieldsArgs {
2423

2524
export function aliasGatsbyNodeFields(
2625
args: IAliasGatsbyNodeFieldsArgs
27-
): Visitor<ASTKindToNode> {
26+
): ASTVisitor {
2827
return {
2928
Field: (node: FieldNode) => {
3029
if (isTypeName(node) || isNodeType(args.typeInfo.getParentType(), args)) {

src/compile-node-queries/ast-transformers/remove-unused-fragments.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { ASTKindToNode, Visitor } from "graphql"
1+
import { ASTVisitor } from "graphql"
22
import * as GraphQLAST from "../../utils/ast-nodes"
33
import { isFragment, isOperation } from "../../utils/ast-predicates"
44

55
type FragmentName = string
66

7-
export function removeUnusedFragments(): Visitor<ASTKindToNode> {
7+
export function removeUnusedFragments(): ASTVisitor {
88
let currentSpreads: Array<FragmentName> = []
99
const definitionSpreads: Map<string, Array<FragmentName>> = new Map()
1010

src/compile-node-queries/ast-transformers/replace-node-selection-with-reference.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import {
22
TypeInfo,
33
isInterfaceType,
4-
Visitor,
5-
ASTKindToNode,
4+
ASTVisitor,
65
getNamedType,
76
GraphQLSchema,
87
GraphQLInterfaceType,
98
FieldNode,
109
SelectionNode,
1110
GraphQLObjectType,
1211
FragmentDefinitionNode,
12+
Kind,
1313
} from "graphql"
1414
import { FragmentMap } from "../../types"
1515
import * as GraphQLAST from "../../utils/ast-nodes"
@@ -42,7 +42,7 @@ interface ITransformArgs {
4242
*/
4343
export function replaceNodeSelectionWithReference(
4444
args: ITransformArgs
45-
): Visitor<ASTKindToNode> {
45+
): ASTVisitor {
4646
return {
4747
Field: node => {
4848
const type = args.typeInfo.getType()
@@ -96,7 +96,7 @@ function transformInterfaceField(
9696
return {
9797
...node,
9898
selectionSet: {
99-
kind: "SelectionSet",
99+
kind: Kind.SELECTION_SET,
100100
selections: [GraphQLAST.field(`__typename`), ...selections],
101101
},
102102
}

src/compile-node-queries/ast-transformers/strip-wrapping-fragments.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { SelectionSetNode, Visitor, ASTKindToNode } from "graphql"
1+
import { SelectionSetNode, ASTVisitor } from "graphql"
22

33
/**
44
* Strip unnecessary wrapping (just a prettify)
55
* i.e. { ...on InterfaceType { ...on ObjectType1 ...on ObjectType2 } }
66
* -> { ...on ObjectType1 ...on ObjectType2 }
77
*/
8-
export function stripWrappingFragments(): Visitor<ASTKindToNode> {
8+
export function stripWrappingFragments(): ASTVisitor {
99
return {
1010
SelectionSet: {
1111
leave: (node: SelectionSetNode) => {

src/compile-node-queries/generate-default-fragments.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ import {
1717
ArgumentNode,
1818
astFromValue,
1919
isNonNullType,
20-
Visitor,
21-
ASTKindToNode,
20+
ASTVisitor,
2221
FragmentSpreadNode,
2322
TypeInfo,
2423
} from "graphql"
@@ -122,7 +121,7 @@ function generateDefaultFragment(
122121

123122
function inlineNamedFragments(
124123
args: IGenerateDefaultFragmentContext
125-
): Visitor<ASTKindToNode> {
124+
): ASTVisitor {
126125
const typeStack: string[] = []
127126
return {
128127
FragmentSpread: (node: FragmentSpreadNode, _, __) => {

0 commit comments

Comments
 (0)