Skip to content

Commit

Permalink
update ts code and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lolopinto committed May 20, 2022
1 parent feb4047 commit 61ecedf
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 98 deletions.
114 changes: 56 additions & 58 deletions ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"peerDependencies": {
"better-sqlite3": "^7.4.1",
"graphql": "^15.5"
"graphql": "^16.5.0"
},
"peerDependenciesMeta": {
"better-sqlite3": {
Expand All @@ -47,7 +47,7 @@
"@types/better-sqlite3": "^5.4.1",
"@types/express": "^4.17.9",
"@types/glob": "^7.1.1",
"@types/graphql-upload": "^8.0.4",
"@types/graphql-upload": "^8.0.11",
"@types/jest": "^27.0.3",
"@types/jest-expect-message": "^1.0.1",
"@types/js-yaml": "^4.0.1",
Expand All @@ -64,9 +64,9 @@
"email-addresses": "^5.0.0",
"express": "^4.17.1",
"express-graphql": "^0.12.0",
"graphql": "15.5",
"graphql": "^16.5.0",
"graphql-type-json": "^0.3.2",
"graphql-upload": "^12.0.0",
"graphql-upload": "^13.0.0",
"jest": "^27.4.3",
"jest-date-mock": "^1.0.8",
"jest-each": "^27.4.2",
Expand Down
2 changes: 1 addition & 1 deletion ts/packages/ent-graphql-tests/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function getInnerType(typ, list) {
function makeGraphQLRequest(
config: queryConfig,
query: string,
fieldArgs: GraphQLArgument[],
fieldArgs: Readonly<GraphQLArgument[]>,
): [supertest.SuperTest<supertest.Test>, supertest.Test] {
let test: supertest.SuperTest<supertest.Test>;

Expand Down
10 changes: 7 additions & 3 deletions ts/src/graphql/builtins/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ export const GraphQLConnectionInterface = new GraphQLInterfaceType({
description: "connection interface",
fields: () => ({
edges: {
type: GraphQLNonNull(GraphQLList(GraphQLNonNull(GraphQLEdgeInterface))),
type: new GraphQLNonNull(
new GraphQLList(new GraphQLNonNull(GraphQLEdgeInterface)),
),
},
nodes: {
type: GraphQLNonNull(GraphQLList(GraphQLNonNull(GraphQLNodeInterface))),
type: new GraphQLNonNull(
new GraphQLList(new GraphQLNonNull(GraphQLNodeInterface)),
),
},
pageInfo: {
type: GraphQLNonNull(GraphQLPageInfo),
type: new GraphQLNonNull(GraphQLPageInfo),
},
}),
});
4 changes: 2 additions & 2 deletions ts/src/graphql/builtins/edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export const GraphQLEdgeInterface = new GraphQLInterfaceType({
description: "edge interface",
fields: () => ({
node: {
type: GraphQLNonNull(GraphQLNodeInterface),
type: new GraphQLNonNull(GraphQLNodeInterface),
},
cursor: {
type: GraphQLNonNull(GraphQLString),
type: new GraphQLNonNull(GraphQLString),
},
}),
});
2 changes: 1 addition & 1 deletion ts/src/graphql/builtins/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const GraphQLNodeInterface = new GraphQLInterfaceType({
description: "node interface",
fields: () => ({
id: {
type: GraphQLNonNull(GraphQLID),
type: new GraphQLNonNull(GraphQLID),
},
}),
});
4 changes: 2 additions & 2 deletions ts/src/graphql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ export const addCustomType = (type: CustomType) => {
description: ct.description,
name: ct.name,
};
if (ct.specifiedByUrl) {
type.scalarInfo.specifiedByUrl = ct.specifiedByUrl;
if (ct.specifiedByURL) {
type.scalarInfo.specifiedByUrl = ct.specifiedByURL;
}
}
} catch (e) {
Expand Down
6 changes: 3 additions & 3 deletions ts/src/graphql/node_resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ function commonTests() {
name: "User",
fields: {
id: {
type: GraphQLNonNull(GraphQLID),
type: new GraphQLNonNull(GraphQLID),
resolve: nodeIDEncoder,
},
firstName: {
Expand All @@ -314,7 +314,7 @@ function commonTests() {
name: "Viewer",
fields: {
user: {
type: GraphQLNonNull(userType),
type: new GraphQLNonNull(userType),
resolve: (_source, {}, context: RequestContext) => {
const v = context.getViewer();
if (!v.viewerID) {
Expand All @@ -333,7 +333,7 @@ function commonTests() {
node: {
args: {
id: {
type: GraphQLNonNull(GraphQLID),
type: new GraphQLNonNull(GraphQLID),
},
},
type: GraphQLNodeInterface,
Expand Down
Loading

0 comments on commit 61ecedf

Please sign in to comment.