Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
BREAKING CHANGE: drop Node 4 support, requires `node >= v6.0.0`
  • Loading branch information
nodkz committed Sep 5, 2018
1 parent b2e9ae7 commit 230c2b1
Show file tree
Hide file tree
Showing 7 changed files with 1,013 additions and 884 deletions.
65 changes: 38 additions & 27 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
{
"plugins": [
"transform-object-rest-spread",
"transform-flow-strip-types",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-flow-strip-types"
],
"env": {
"cjs": {
"plugins": [
"transform-class-properties",
["transform-runtime", { "polyfill": false }]
"@babel/plugin-proposal-class-properties"
],
"presets": [
["env", {
"targets": {
"node": 6
},
}]
[
"@babel/preset-env",
{
"targets": {
"node": 6
}
}
]
]
},
"mjs": {
"plugins": ["transform-class-properties"],
"plugins": [
"@babel/plugin-proposal-class-properties"
],
"presets": [
[
"env",
"@babel/preset-env",
{
"targets": {
"node": "8.0.0"
Expand All @@ -33,33 +37,40 @@
]
},
"es": {
"plugins": ["transform-class-properties"],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
},
"node8": {
"plugins": [
"transform-class-properties",
["transform-runtime", { "polyfill": false }]
"@babel/plugin-proposal-class-properties"
],
"presets": [
["env", {
"targets": {
"node": "8.0.0"
},
"loose": true,
"modules": "commonjs"
}]
[
"@babel/preset-env",
{
"targets": {
"node": "8.0.0"
},
"loose": true,
"modules": "commonjs"
}
]
]
},
"test": {
"plugins": [
"transform-class-properties",
"@babel/plugin-proposal-class-properties"
],
"presets": [
["env", {
"targets": {
"node": "current"
},
}]
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cache:
notifications:
email: true
node_js:
- "9"
- "10"
- "8"
script:
- yarn run test
Expand Down
51 changes: 26 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,50 +28,51 @@
},
"homepage": "https://github.com/graphql-compose/graphql-compose-mongoose",
"dependencies": {
"babel-runtime": "^6.26.0",
"object-path": "^0.11.4"
},
"optionalDependencies": {
"graphql-compose-connection": ">=3.2.1",
"graphql-compose-pagination": ">=3.3.0"
"graphql-compose-connection": ">=4.0.0",
"graphql-compose-pagination": ">=4.0.0"
},
"peerDependencies": {
"graphql-compose": ">=4.7.1",
"mongoose": ">=4.4.0 || >=5.0.0"
"graphql-compose": ">=5.0.2 || >=4.7.1",
"mongoose": ">=5.0.0 || >=4.4.0"
},
"devDependencies": {
"@types/graphql": "^0.13.4",
"@types/mongoose": "^5.2.6",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.6",
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-flow-strip-types": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-flow": "^7.0.0",
"@types/graphql": "^14.0.0",
"@types/mongoose": "^5.2.10",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^9.0.0",
"babel-jest": "^23.4.2",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.13.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"cz-conventional-changelog": "^2.1.0",
"eslint": "^5.4.0",
"eslint": "^5.5.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^3.0.1",
"eslint-plugin-flowtype": "^2.50.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-prettier": "^2.6.2",
"flow-bin": "^0.79.1",
"graphql": "0.13.2",
"graphql-compose": "^4.8.2",
"graphql-compose-connection": ">=3.2.1",
"graphql-compose-pagination": ">=3.3.0",
"flow-bin": "^0.80.0",
"graphql": "14.0.0",
"graphql-compose": "^5.0.2",
"graphql-compose-connection": ">=4.0.0",
"graphql-compose-pagination": ">=4.0.0",
"jest": "^23.5.0",
"mongodb-memory-server": "^2.0.1",
"mongoose": "^5.2.9",
"mongodb-memory-server": "^2.1.0",
"mongoose": "^5.2.13",
"prettier": "^1.14.2",
"request": "^2.88.0",
"rimraf": "^2.6.2",
"semantic-release": "^15.9.9",
"semantic-release": "^15.9.12",
"tslint": "^5.11.0",
"typescript": "^3.0.1"
"typescript": "^3.0.3"
},
"config": {
"commitizen": {
Expand Down
4 changes: 3 additions & 1 deletion src/__mocks__/mongooseCommon.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* @flow */
/* eslint-disable no-param-reassign, no-console */

import mongoose, { Schema, Types } from 'mongoose';
import mongoose from 'mongoose';
import MongodbMemoryServer from 'mongodb-memory-server';

const { Schema, Types } = mongoose;

mongoose.Promise = Promise;

jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
Expand Down
5 changes: 3 additions & 2 deletions src/discriminators/DiscriminatorTypeComposer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* @flow */

import type { ComposeFieldConfigMap } from 'graphql-compose';
import {
EnumTypeComposer,
schemaComposer,
Expand All @@ -10,6 +9,7 @@ import {
type ComposeFieldConfig,
type RelationOpts,
type GetRecordIdFn,
type ComposeFieldConfigMap,
} from 'graphql-compose';
import type { ComposePartialFieldConfigAsObject } from 'graphql-compose/lib/TypeComposer';
import type { Model } from 'mongoose';
Expand Down Expand Up @@ -97,7 +97,8 @@ export class DiscriminatorTypeComposer<TContext> extends TypeComposerClass<TCont
throw Error('Discriminator Key not Set, Use composeWithMongoose for Normal Collections');
}

opts = { // eslint-disable-line
// eslint-disable-next-line
opts = {
reorderFields: true,
schemaComposer,
...opts,
Expand Down
10 changes: 4 additions & 6 deletions src/resolvers/__tests__/findOne-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,19 @@ describe('findOne() ->', () => {
});

it('should have `filter` arg only with indexed fields', async () => {
const result: any = findOne(UserModel, UserTC, {
const resolver = findOne(UserModel, UserTC, {
filter: { onlyIndexed: true, operators: false },
});
const filterFields = result.args.filter.type._typeConfig.fields();
expect(Object.keys(filterFields)).toEqual(
expect(resolver.getArgTC('filter').getFieldNames()).toEqual(
expect.arrayContaining(['_id', 'name', 'employment'])
);
});

it('should have `filter` arg with required `name` field', async () => {
const result: any = findOne(UserModel, UserTC, {
const resolver = findOne(UserModel, UserTC, {
filter: { requiredFields: 'name' },
});
const filterFields = result.args.filter.type._typeConfig.fields();
expect(filterFields.name.type).toBeInstanceOf(GraphQLNonNull);
expect(resolver.getArgTC('filter').getFieldType('name')).toBeInstanceOf(GraphQLNonNull);
});

it('should have `skip` arg', () => {
Expand Down
Loading

0 comments on commit 230c2b1

Please sign in to comment.