Skip to content

Commit

Permalink
Merge pull request #127 from GP4cK/upgrade-graphql
Browse files Browse the repository at this point in the history
Upgrade graphQL v11
  • Loading branch information
TriPSs authored Apr 21, 2023
2 parents 5246cd9 + 5f819fa commit 38d75a1
Show file tree
Hide file tree
Showing 25 changed files with 283 additions and 493 deletions.
2 changes: 1 addition & 1 deletion examples/complexity/e2e/sub-task.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ describe('SubTaskResolver (complexity - e2e)', () => {
}
}`
})
.expect(400)
.expect(500)
.then(({ body }) => {
expect(body).toEqual({
errors: [
Expand Down
2 changes: 1 addition & 1 deletion examples/complexity/e2e/tag.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ describe('TagResolver (complexity - e2e)', () => {
}
}`
})
.expect(400)
.expect(500)
.then(({ body }) => {
expect(body).toEqual({
errors: [
Expand Down
2 changes: 1 addition & 1 deletion examples/complexity/e2e/todo-item.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ describe('TodoItemResolver (complexity - e2e)', () => {
}
}`
})
.expect(400)
.expect(500)
.then(({ body }) => {
expect(body).toEqual({
errors: [
Expand Down
4 changes: 2 additions & 2 deletions examples/complexity/src/complexity.plugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ApolloServerPlugin, GraphQLRequestListener } from '@apollo/server'
import { Plugin } from '@nestjs/apollo'
import { Logger, LoggerService } from '@nestjs/common'
import { GraphQLSchemaHost } from '@nestjs/graphql'
import { ApolloServerPlugin, GraphQLRequestListener } from 'apollo-server-plugin-base'
import { GraphQLError } from 'graphql'
import { fieldExtensionsEstimator, getComplexity, simpleEstimator } from 'graphql-query-complexity'

Expand All @@ -15,7 +15,7 @@ export class ComplexityPlugin implements ApolloServerPlugin {
this.logger = new Logger('complexity-plugin')
}

requestDidStart(): Promise<GraphQLRequestListener> {
requestDidStart(): Promise<GraphQLRequestListener<unknown>> {
const { schema } = this.gqlSchemaHost

return Promise.resolve({
Expand Down
2 changes: 1 addition & 1 deletion examples/filters/e2e/todo-item.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('TodoItemResolver (filters - e2e)', () => {
})
.expect(200)
.then(({ body }) => {
expect(body.errors[0].extensions.response.message[0]).toBe('filter.There was no filter provided for "completed"!')
expect(body.errors[0].extensions.originalError.message[0]).toBe('filter.There was no filter provided for "completed"!')
}))
})

Expand Down
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,19 @@
},
"dependencies": {
"@apollo/federation": "0.38.1",
"@apollo/server": "^4.6.0",
"@docusaurus/core": "2.2.0",
"@docusaurus/preset-classic": "2.2.0",
"@m8a/nestjs-typegoose": "11.0.0",
"@nestjs/common": "9.3.12",
"@nestjs/core": "9.3.12",
"@nestjs/graphql": "10.1.3",
"@nestjs/graphql": "^11.0.5",
"@nestjs/jwt": "10.0.3",
"@nestjs/mongoose": "9.2.0",
"@nestjs/passport": "9.0.0",
"@nestjs/platform-express": "9.1.4",
"@nestjs/sequelize": "9.0.0",
"@nestjs/typeorm": "^9.0.1",
"apollo-server-core": "3.11.1",
"apollo-server-express": "3.11.1",
"apollo-server-plugin-base": "3.7.1",
"apollo-server-types": "3.7.1",
"class-validator": "0.14.0",
"clsx": "^1.2.1",
"mongoose": "^7.0.3",
Expand All @@ -54,7 +51,7 @@
"@commitlint/config-conventional": "^17.4.2",
"@docusaurus/module-type-aliases": "2.2.0",
"@jscutlery/semver": "2.26.0",
"@nestjs/apollo": "^10.0.22",
"@nestjs/apollo": "^11.0.5",
"@nestjs/cli": "8.2.8",
"@nestjs/schematics": "8.0.11",
"@nestjs/testing": "^9.3.12",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ type OffsetPageInfo {
type Query {
testResolverDTOS(
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: TestResolverDTOFilter = {}
filter: TestResolverDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestResolverDTOSort!] = []
sorting: [TestResolverDTOSort!]! = []
): TestResolverDTOConnection!
test: TestResolverDTO!
}
Expand Down Expand Up @@ -196,13 +196,13 @@ type Query {
other: String!
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: TestResolverDTOFilter = {}
filter: TestResolverDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestResolverDTOSort!] = []
sorting: [TestResolverDTOSort!]! = []
): TestResolverDTOConnection!
test: TestResolverDTO!
}
Expand Down Expand Up @@ -388,13 +388,13 @@ type Query {
): TestResolverDTO!
testResolverDTOS(
"""Limit or page results."""
paging: OffsetPaging = {limit: 10}
paging: OffsetPaging! = {limit: 10}
"""Specify to filter the records returned."""
filter: TestResolverDTOFilter = {}
filter: TestResolverDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestResolverDTOSort!] = []
sorting: [TestResolverDTOSort!]! = []
): TestResolverDTOConnection!
test: TestResolverDTO!
}
Expand Down Expand Up @@ -526,13 +526,13 @@ type Query {
): TestResolverDTO!
testResolverDTOS(
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: TestResolverDTOFilter = {}
filter: TestResolverDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestResolverDTOSort!] = []
sorting: [TestResolverDTOSort!]! = []
): TestResolverDTOConnection!
test: TestResolverDTO!
}
Expand Down Expand Up @@ -670,13 +670,13 @@ type Query {
): TestResolverDTO!
testResolverDTOS(
"""Limit or page results."""
paging: OffsetPaging = {limit: 10}
paging: OffsetPaging! = {limit: 10}
"""Specify to filter the records returned."""
filter: TestResolverDTOFilter = {}
filter: TestResolverDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestResolverDTOSort!] = []
sorting: [TestResolverDTOSort!]! = []
): TestResolverDTOConnection!
test: TestResolverDTO!
}
Expand Down Expand Up @@ -808,13 +808,13 @@ type Query {
): TestResolverDTO!
testResolverDTOS(
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: TestResolverDTOFilter = {}
filter: TestResolverDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestResolverDTOSort!] = []
sorting: [TestResolverDTOSort!]! = []
): TestResolverDTOConnection!
test: TestResolverDTO!
}
Expand Down Expand Up @@ -952,13 +952,13 @@ type Query {
): TestResolverDTO!
testResolverDTOS(
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: TestResolverDTOFilter = {}
filter: TestResolverDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestResolverDTOSort!] = []
sorting: [TestResolverDTOSort!]! = []
): TestResolverDTOConnection!
test: TestResolverDTO!
}
Expand Down Expand Up @@ -1096,13 +1096,13 @@ type Query {
): TestResolverDTO!
testResolverDTOS(
"""Limit or page results."""
paging: OffsetPaging = {limit: 10}
paging: OffsetPaging! = {limit: 10}
"""Specify to filter the records returned."""
filter: TestResolverDTOFilter = {}
filter: TestResolverDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestResolverDTOSort!] = []
sorting: [TestResolverDTOSort!]! = []
): TestResolverDTOConnection!
test: TestResolverDTO!
}
Expand Down Expand Up @@ -1275,13 +1275,13 @@ type Query {
test: TestResolverDTO!
tests(
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: TestResolverDTOFilter = {}
filter: TestResolverDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestResolverDTOSort!] = []
sorting: [TestResolverDTOSort!]! = []
): TestConnection!
}
Expand Down Expand Up @@ -1418,13 +1418,13 @@ type Query {
): TestResolverDTO!
read_many_test(
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: TestResolverDTOFilter = {}
filter: TestResolverDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestResolverDTOSort!] = []
sorting: [TestResolverDTOSort!]! = []
): TestResolverDTOConnection!
test: TestResolverDTO!
}
Expand Down Expand Up @@ -1562,13 +1562,13 @@ type Query {
): TestResolverDTO!
testResolverDTOS(
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: TestResolverDTOFilter = {}
filter: TestResolverDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestResolverDTOSort!] = []
sorting: [TestResolverDTOSort!]! = []
): TestResolverDTOConnection!
test: TestResolverDTO!
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,30 +62,30 @@ type TestFederated {
custom: TestRelationDTO!
unPagedRelations(
"""Specify to filter the records returned."""
filter: TestRelationDTOFilter = {}
filter: TestRelationDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestRelationDTOSort!] = []
sorting: [TestRelationDTOSort!]! = []
): [TestRelationDTO!]!
relationOffsetConnections(
"""Limit or page results."""
paging: OffsetPaging = {limit: 10}
paging: OffsetPaging! = {limit: 10}
"""Specify to filter the records returned."""
filter: TestRelationDTOFilter = {}
filter: TestRelationDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestRelationDTOSort!] = []
sorting: [TestRelationDTOSort!]! = []
): TestFederatedRelationOffsetConnectionsConnection!
relationCursorConnections(
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: TestRelationDTOFilter = {}
filter: TestRelationDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestRelationDTOSort!] = []
sorting: [TestRelationDTOSort!]! = []
): TestFederatedRelationCursorConnectionsConnection!
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ type TestResolverDTO {
stringField: String!
relations(
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to sort results."""
sorting: [TestRelationDTOSort!] = []
sorting: [TestRelationDTOSort!]! = []
): TestResolverDTORelationsConnection!
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ type TestResolverDTO {
stringField: String!
relations(
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: TestRelationDTOFilter = {}
filter: TestRelationDTOFilter! = {}
): TestResolverDTORelationsConnection!
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ type TestResolverDTO {
stringField: String!
relations(
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: TestRelationDTOFilter = {}
filter: TestRelationDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestRelationDTOSort!] = []
sorting: [TestRelationDTOSort!]! = []
): TestResolverDTORelationsConnection!
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ type TestResolverDTO {
stringField: String!
tests(
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: TestRelationDTOFilter = {}
filter: TestRelationDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestRelationDTOSort!] = []
sorting: [TestRelationDTOSort!]! = []
): TestResolverDTOTestsConnection!
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ type TestResolverDTO {
stringField: String!
relations(
"""Limit or page results."""
paging: CursorPaging = {first: 10}
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: TestRelationDTOFilter = {}
filter: TestRelationDTOFilter! = {}
"""Specify to sort results."""
sorting: [TestRelationDTOSort!] = []
sorting: [TestRelationDTOSort!]! = []
): TestResolverDTORelationsConnection
}
Expand Down
Loading

0 comments on commit 38d75a1

Please sign in to comment.