graphql-compose-aws
Advanced tools
Comparing version 3.0.0 to 4.0.0
@@ -5,4 +5,2 @@ "use strict"; | ||
var _graphql = require("graphql-compose/lib/graphql"); | ||
var _AwsParam = require("../AwsParam"); | ||
@@ -119,5 +117,4 @@ | ||
expect(itc.getTypeName()).toBe('AwsS3BucketInput'); | ||
expect(itc.getFieldType('Bucket')).toBeInstanceOf(_graphql.GraphQLNonNull); | ||
expect(itc.getFieldType('Bucket').ofType).toBe(_graphql.GraphQLString); | ||
expect(itc.getFieldType('Delimiter')).toBe(_graphql.GraphQLString); | ||
expect(itc.getFieldTypeName('Bucket')).toBe('String!'); | ||
expect(itc.getFieldTypeName('Delimiter')).toBe('String'); | ||
}); | ||
@@ -144,6 +141,5 @@ it('static convertOutputStructure()', () => { | ||
expect(tc.getTypeName()).toBe('AwsS3Bucket'); | ||
expect(tc.getFieldType('Bucket')).toBeInstanceOf(_graphql.GraphQLNonNull); | ||
expect(tc.getFieldType('Bucket').ofType).toBe(_graphql.GraphQLString); | ||
expect(tc.getFieldType('Delimiter')).toBe(_graphql.GraphQLString); | ||
expect(tc.getFieldTypeName('Bucket')).toBe('String!'); | ||
expect(tc.getFieldTypeName('Delimiter')).toBe('String'); | ||
}); | ||
}); |
"use strict"; | ||
var _graphql = require("graphql-compose/lib/graphql"); | ||
var _graphqlCompose = require("graphql-compose"); | ||
var _graphql = require("graphql"); | ||
var _AwsServiceOperation = require("../AwsServiceOperation"); | ||
@@ -11,6 +13,3 @@ | ||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } | ||
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } | ||
/* eslint-disable class-methods-use-this */ | ||
const operations = { | ||
@@ -100,11 +99,11 @@ CreateBucket: { | ||
const tc = oper.getType(); | ||
expect((0, _graphql.isOutputType)(tc)).toBeTruthy(); | ||
expect(tc).toBeInstanceOf(_graphql.GraphQLObjectType); | ||
}); | ||
it('getArgs()', () => { | ||
const args = oper.getArgs(); | ||
expect(args.input).toBeDefined(); // input arg has required fields, so it wrapped by GraphQLNonNull | ||
expect(args.input).toBeDefined(); // input arg has required fields, so it wrapped by NonNullComposer | ||
expect(args.input.type).toBeInstanceOf(_graphql.GraphQLNonNull); | ||
expect(args.input.type.ofType).toBeInstanceOf(_graphql.GraphQLInputObjectType); | ||
expect(args.input.type.ofType.name).toBe('AWSS3CreateBucketInput'); | ||
expect(args.input.type).toBeInstanceOf(_graphqlCompose.NonNullComposer); | ||
expect(args.input.type.ofType).toBeInstanceOf(_graphqlCompose.InputTypeComposer); | ||
expect(args.input.type.ofType.getTypeName()).toBe('AWSS3CreateBucketInput'); | ||
}); | ||
@@ -116,5 +115,3 @@ describe('getResolve()', () => { | ||
}); | ||
it('resolves', | ||
/*#__PURE__*/ | ||
_asyncToGenerator(function* () { | ||
it('resolves', async () => { | ||
AWSMock.S3 = class S3WithPayload { | ||
@@ -128,3 +125,3 @@ CreateBucket(args, cb) { | ||
}; | ||
const res = yield resolve({}, { | ||
const res = await resolve({}, { | ||
input: { | ||
@@ -139,6 +136,4 @@ arg: 123 | ||
}); | ||
})); | ||
it('rejects', | ||
/*#__PURE__*/ | ||
_asyncToGenerator(function* () { | ||
}); | ||
it('rejects', async () => { | ||
AWSMock.S3 = class S3WithError { | ||
@@ -153,7 +148,7 @@ CreateBucket(args, cb) { | ||
try { | ||
yield resolve({}, {}, {}, {}); | ||
await resolve({}, {}, {}, {}); | ||
} catch (e) { | ||
expect(e).toBe('err'); | ||
} | ||
})); | ||
}); | ||
}); | ||
@@ -160,0 +155,0 @@ it('getFieldConfig()', () => { |
@@ -36,5 +36,6 @@ "use strict"; | ||
// uid: 's3-2006-03-01' } | ||
const _this$metadata = this.metadata, | ||
serviceFullName = _this$metadata.serviceFullName, | ||
apiVersion = _this$metadata.apiVersion; | ||
const { | ||
serviceFullName, | ||
apiVersion | ||
} = this.metadata; | ||
return `${serviceFullName} (${apiVersion})`; | ||
@@ -41,0 +42,0 @@ } |
@@ -8,3 +8,3 @@ "use strict"; | ||
enumerable: true, | ||
get: function get() { | ||
get: function () { | ||
return _AwsApiParser.AwsApiParser; | ||
@@ -11,0 +11,0 @@ } |
{ | ||
"name": "graphql-compose-aws", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "AWS Cloud API via GraphQL", | ||
@@ -28,46 +28,35 @@ "files": [ | ||
"peerDependencies": { | ||
"graphql-compose": ">=6.0.0" | ||
"graphql-compose": ">=7.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.3.4", | ||
"@babel/cli": "^7.4.4", | ||
"@babel/core": "^7.4.4", | ||
"@babel/node": "^7.2.2", | ||
"@babel/plugin-proposal-class-properties": "^7.3.4", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.3.4", | ||
"@babel/plugin-transform-flow-strip-types": "^7.3.4", | ||
"@babel/plugin-transform-runtime": "^7.3.4", | ||
"@babel/preset-env": "^7.3.4", | ||
"@babel/plugin-proposal-class-properties": "^7.4.4", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.4.4", | ||
"@babel/plugin-transform-flow-strip-types": "^7.4.4", | ||
"@babel/plugin-transform-runtime": "^7.4.4", | ||
"@babel/preset-env": "^7.4.4", | ||
"@babel/preset-flow": "^7.0.0", | ||
"aws-sdk": "^2.422.0", | ||
"aws-sdk": "^2.444.0", | ||
"babel-core": "^7.0.0-bridge.0", | ||
"babel-eslint": "^10.0.1", | ||
"babel-jest": "^24.5.0", | ||
"cz-conventional-changelog": "^2.1.0", | ||
"eslint": "^5.15.2", | ||
"babel-jest": "^24.7.1", | ||
"eslint": "^5.16.0", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
"eslint-config-prettier": "^4.1.0", | ||
"eslint-plugin-flowtype": "^3.4.2", | ||
"eslint-plugin-import": "^2.16.0", | ||
"eslint-config-prettier": "^4.2.0", | ||
"eslint-plugin-flowtype": "^3.6.1", | ||
"eslint-plugin-import": "^2.17.2", | ||
"eslint-plugin-prettier": "^3.0.1", | ||
"express": "^4.16.4", | ||
"express-graphql": "^0.7.1", | ||
"flow-bin": "^0.95.1", | ||
"graphql": "14.1.1", | ||
"graphql-compose": "^6.0.1", | ||
"jest": "^24.5.0", | ||
"nodemon": "^1.18.10", | ||
"prettier": "^1.16.4", | ||
"express-graphql": "^0.8.0", | ||
"flow-bin": "^0.98.0", | ||
"graphql": "14.2.1", | ||
"graphql-compose": "^7.0.0", | ||
"jest": "^24.7.1", | ||
"nodemon": "^1.18.11", | ||
"prettier": "^1.17.0", | ||
"rimraf": "^2.6.3", | ||
"semantic-release": "^15.13.3" | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "./node_modules/cz-conventional-changelog" | ||
} | ||
}, | ||
"jest": { | ||
"roots": [ | ||
"<rootDir>/src" | ||
] | ||
}, | ||
"scripts": { | ||
@@ -80,5 +69,5 @@ "build": "npm run build-cjs && npm run build-mjs", | ||
"demo": "npm run demo-fullApi", | ||
"demo-fullApi": "nodemon -e js --ignore *test* --exec ./node_modules/.bin/babel-node ./examples/fullApi/index.js", | ||
"demo-introspection": "./node_modules/.bin/babel-node ./examples/introspection/generate.js", | ||
"demo-partialApi": "nodemon -e js --ignore *test* --exec ./node_modules/.bin/babel-node ./examples/partialApi/index.js", | ||
"demo-fullApi": "BABEL_ENV=cjs nodemon -e js --ignore *test* --exec ./node_modules/.bin/babel-node ./examples/fullApi/index.js", | ||
"demo-introspection": "BABEL_ENV=cjs ./node_modules/.bin/babel-node ./examples/introspection/generate.js", | ||
"demo-partialApi": "BABEL_ENV=cjs nodemon -e js --ignore *test* --exec ./node_modules/.bin/babel-node ./examples/partialApi/index.js", | ||
"watch": "jest --watch", | ||
@@ -85,0 +74,0 @@ "coverage": "jest --coverage", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
29
104024
1688