Skip to content

Upgrade graphql-query-complexity dependency and related code #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Features
- **Breaking Change**: emit in schema only types actually used by provided resolvers classes (#415)
- **Breaking Change**: update `graphql-js` peer dependency to `^14.5.4`

- **Breaking Change**: update `graphql-query-complexity` dependency to `^0.4.0` and drop support for `fieldConfigEstimator` (use `fieldExtensionsEstimator` instead)
### Fixes
- refactor union types function syntax handling to prevent possible errors with circular refs

Expand All @@ -15,7 +15,6 @@
- update deps to newest minor versions (`tslib`, `semver`, `graphql-query-complexity` and `glob`)
- support nested array types (`@Field(type => [[Int]])`) (#393)
- deprecate the direct array syntax for union types

### Fixes
- fix errors on circular refs in union types (#364) by adding the function syntax (`() => TClassTypes`)

Expand Down
4 changes: 2 additions & 2 deletions docs/complexity.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ async function bootstrap() {
// numeric value that is being returned by an estimator is used as the field complexity.
// If no estimator returns a value, an exception is raised.
estimators: [
// Using fieldConfigEstimator is mandatory to make it work with type-graphql.
fieldConfigEstimator(),
// Using fieldExtensionsEstimator is mandatory to make it work with type-graphql.
fieldExtensionsEstimator(),
// Add more estimators here...
// This will assign each field a complexity of 1
// if no other estimator returned a value.
Expand Down
6 changes: 3 additions & 3 deletions examples/query-complexity/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "reflect-metadata";
import { ApolloServer } from "apollo-server";
import { getComplexity, simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity";
import { getComplexity, simpleEstimator, fieldExtensionsEstimator } from "graphql-query-complexity";
import { separateOperations } from "graphql";
import { buildSchema } from "../../src";

Expand Down Expand Up @@ -40,8 +40,8 @@ async function bootstrap() {
// numeric value that is being returned by an estimator is used as the field complexity.
// If no estimator returns a value, an exception is raised.
estimators: [
// Using fieldConfigEstimator is mandatory to make it work with type-graphql.
fieldConfigEstimator(),
// Using fieldExtensionsEstimator is mandatory to make it work with type-graphql.
fieldExtensionsEstimator(),
// Add more estimators here...
// This will assign each field a complexity of 1
// if no other estimator returned a value.
Expand Down
Loading