Skip to content

Commit

Permalink
fix: upgrade flow till v0.118
Browse files Browse the repository at this point in the history
  • Loading branch information
nodkz committed Feb 15, 2020
1 parent 3c1c17d commit a9041b2
Show file tree
Hide file tree
Showing 14 changed files with 1,175 additions and 900 deletions.
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,46 +31,46 @@
"object-path": "^0.11.4"
},
"optionalDependencies": {
"graphql-compose-connection": "^6.0.3",
"graphql-compose-connection": "6.0.4",
"graphql-compose-pagination": "^6.0.3"
},
"peerDependencies": {
"graphql-compose": "^7.1.0",
"mongoose": "^5.0.0 || ^4.4.0"
},
"devDependencies": {
"@babel/cli": "7.8.3",
"@babel/core": "7.8.3",
"@babel/cli": "7.8.4",
"@babel/core": "7.8.4",
"@babel/plugin-proposal-class-properties": "7.8.3",
"@babel/plugin-proposal-object-rest-spread": "7.8.3",
"@babel/plugin-transform-flow-strip-types": "7.8.3",
"@babel/plugin-transform-runtime": "7.8.3",
"@babel/preset-env": "7.8.3",
"@babel/preset-env": "7.8.4",
"@babel/preset-flow": "7.8.3",
"@types/graphql": "^14.5.0",
"@types/mongoose": "5.5.41",
"@types/mongoose": "5.7.1",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-jest": "25.1.0",
"eslint": "6.8.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "6.9.0",
"eslint-config-prettier": "6.10.0",
"eslint-plugin-flowtype": "4.6.0",
"eslint-plugin-import": "2.20.0",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-prettier": "3.1.2",
"flow-bin": "^0.110.0",
"graphql": "14.5.8",
"graphql-compose": "7.9.0",
"flow-bin": "0.118.0",
"graphql": "14.6.0",
"graphql-compose": "7.12.0",
"graphql-compose-connection": "^6.0.3",
"graphql-compose-pagination": "^6.0.3",
"jest": "^24.9.0",
"mongodb-memory-server": "6.2.3",
"mongoose": "5.8.9",
"jest": "25.1.0",
"mongodb-memory-server": "6.2.4",
"mongoose": "5.9.1",
"prettier": "^1.19.1",
"request": "^2.88.0",
"rimraf": "^3.0.0",
"request": "2.88.2",
"rimraf": "3.0.2",
"semantic-release": "16.0.2",
"tslint": "^5.20.1",
"tslint": "6.0.0",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "2.1.0",
"typescript": "3.7.5"
Expand Down
5 changes: 2 additions & 3 deletions src/discriminators/DiscriminatorTypeComposer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
type ObjectTypeComposerFieldConfigDefinition,
type ObjectTypeComposerFieldConfigMapDefinition,
type ObjectTypeComposerFieldConfigAsObjectDefinition,
type Thunk,
} from 'graphql-compose';
import type { Model } from 'mongoose';
import { composeWithMongoose, type ComposeWithMongooseOpts } from '../composeWithMongoose';
Expand Down Expand Up @@ -109,7 +108,7 @@ export class DiscriminatorTypeComposer<TSource, TContext> extends ObjectTypeComp
opts = {
reorderFields: true,
schemaComposer,
...opts,
...(opts: any),
};

const baseTC = composeWithMongoose(baseModel, opts);
Expand Down Expand Up @@ -214,7 +213,7 @@ export class DiscriminatorTypeComposer<TSource, TContext> extends ObjectTypeComp

setField(
fieldName: string,
fieldConfig: Thunk<ObjectTypeComposerFieldConfigDefinition<any, any>>
fieldConfig: ObjectTypeComposerFieldConfigDefinition<any, any>
): DiscriminatorTypeComposer<TSource, TContext> {
super.setField(fieldName, fieldConfig);
this.getDInterface().setField(fieldName, (fieldConfig: any));
Expand Down
2 changes: 2 additions & 0 deletions src/resolvers/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ export function prepareCursorQuery(
criteria[k] = cursorData[k];
} else if (ii === i) {
if (indexData[k] === 1) {
// $FlowFixMe
criteria[k] = { [nextOper]: cursorData[k] };
} else {
// $FlowFixMe
criteria[k] = { [prevOper]: cursorData[k] };
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/count.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function count<TSource: MongooseDocument, TContext>(
...filterHelperArgs(tc, model, {
filterTypeName: `Filter${tc.getTypeName()}Input`,
model,
...(opts && opts.filter),
...(opts && (opts.filter: any)),
}),
},
resolve: (resolveParams: ExtendedResolveParams) => {
Expand Down
4 changes: 2 additions & 2 deletions src/resolvers/findByIds.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export default function findByIds<TSource: MongooseDocument, TContext>(
kind: 'query',
args: {
_ids: '[MongoID]!',
...limitHelperArgs({
...(limitHelperArgs({
...(opts && opts.limit),
}),
}): any),
...sortHelperArgs(tc, model, {
sortTypeName: `SortFindByIds${tc.getTypeName()}Input`,
...(opts && opts.sort),
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/findMany.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function findMany<TSource: MongooseDocument, TContext>(
...filterHelperArgs(tc, model, {
filterTypeName: `FilterFindMany${tc.getTypeName()}Input`,
model,
...(opts && opts.filter),
...(opts && (opts.filter: any)),
}),
...skipHelperArgs(),
...limitHelperArgs({
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/findOne.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function findOne<TSource: MongooseDocument, TContext>(
...filterHelperArgs(tc, model, {
filterTypeName: `FilterFindOne${tc.getTypeName()}Input`,
model,
...(opts && opts.filter),
...(opts && (opts.filter: any)),
}),
...skipHelperArgs(),
...sortHelperArgs(tc, model, {
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function pagination<TSource: MongooseDocument, TContext>(
const resolver = preparePaginationResolver(tc, {
findResolverName: 'findMany',
countResolverName: 'count',
...opts,
...(opts: any),
});

return resolver;
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/removeMany.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function removeMany<TSource: MongooseDocument, TContext>(
filterTypeName: `FilterRemoveMany${tc.getTypeName()}Input`,
isRequired: true,
model,
...(opts && opts.filter),
...(opts && (opts.filter: any)),
}),
},
resolve: async (resolveParams: ExtendedResolveParams) => {
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/removeOne.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function removeOne<TSource: MongooseDocument, TContext>(
...filterHelperArgs(tc, model, {
filterTypeName: `FilterRemoveOne${tc.getTypeName()}Input`,
model,
...(opts && opts.filter),
...(opts && (opts.filter: any)),
}),
...sortHelperArgs(tc, model, {
sortTypeName: `SortRemoveOne${tc.getTypeName()}Input`,
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/updateMany.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function updateMany<TSource: MongooseDocument, TContext>(
...filterHelperArgs(tc, model, {
filterTypeName: `FilterUpdateMany${tc.getTypeName()}Input`,
model,
...(opts && opts.filter),
...(opts && (opts.filter: any)),
}),
...sortHelperArgs(tc, model, {
sortTypeName: `SortUpdateMany${tc.getTypeName()}Input`,
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/updateOne.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function updateOne<TSource: MongooseDocument, TContext>(
...filterHelperArgs(tc, model, {
filterTypeName: `FilterUpdateOne${tc.getTypeName()}Input`,
model,
...(opts && opts.filter),
...(opts && (opts.filter: any)),
}),
...sortHelperArgs(tc, model, {
sortTypeName: `SortUpdateOne${tc.getTypeName()}Input`,
Expand Down
3 changes: 2 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"interface-name": false,
"no-reference-import": false,
"interface-over-type-literal": false,
"object-literal-sort-keys": false
"object-literal-sort-keys": false,
"array-type": false
}
}
Loading

0 comments on commit a9041b2

Please sign in to comment.