Skip to content

Commit 8c1e700

Browse files
committed
first commit
0 parents  commit 8c1e700

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+96677
-0
lines changed

.babelrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"plugins": [
3+
"transform-object-rest-spread",
4+
"transform-flow-strip-types",
5+
["transform-runtime", { "polyfill": false }]
6+
],
7+
"presets": [
8+
["env", {
9+
"targets": {
10+
"node": 4
11+
},
12+
}]
13+
],
14+
}

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
flow-typed
2+
lib

.eslintrc

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"extends": [
3+
"airbnb-base",
4+
"prettier"
5+
],
6+
"parser": "babel-eslint",
7+
"rules": {
8+
"no-underscore-dangle": 0,
9+
"arrow-body-style": 0,
10+
"arrow-parens": 0,
11+
"prefer-template": 0,
12+
"no-use-before-define": 0,
13+
"no-else-return": 0,
14+
"comma-dangle": ["error", {
15+
"arrays": "always-multiline",
16+
"objects": "always-multiline",
17+
"imports": "always-multiline",
18+
"exports": "always-multiline",
19+
"functions": "ignore",
20+
}],
21+
"no-plusplus": 0,
22+
"import/no-extraneous-dependencies": 0,
23+
"import/prefer-default-export": 0,
24+
"prettier/prettier": ["error", {
25+
"printWidth": 100,
26+
"singleQuote": true,
27+
"trailingComma": "es5",
28+
}]
29+
},
30+
"env": {
31+
"jasmine": true,
32+
"jest": true,
33+
},
34+
"plugins": [
35+
"flowtype",
36+
"prettier"
37+
],
38+
"globals": {
39+
"$Shape": true,
40+
"$FlowFixMe": true,
41+
}
42+
}

.flowconfig

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[ignore]
2+
.*/coverage/.*
3+
.*/resources/.*
4+
<PROJECT_ROOT>/lib/.*
5+
<PROJECT_ROOT>/dist/.*
6+
.*/node_modules/ajv.*
7+
.*/node_modules/acorn.*
8+
.*/node_modules/async.*
9+
.*/node_modules/babel.*
10+
.*/node_modules/bluebird.*
11+
.*/node_modules/caniuse-db.*
12+
.*/node_modules/config-chain.*
13+
.*/node_modules/conventional-changelog.*
14+
.*/node_modules/core-js.*
15+
.*/node_modules/cssstyle.*
16+
.*/node_modules/diff.*
17+
.*/node_modules/es5-ext.*
18+
.*/node_modules/escope.*
19+
.*/node_modules/escodegen.*
20+
.*/node_modules/eslint.*
21+
.*/node_modules/github.*
22+
.*/node_modules/fsevents.*
23+
.*/node_modules/jsdoctypeparser.*
24+
.*/node_modules/jsdom.*
25+
.*/node_modules/iconv.*
26+
.*/node_modules/istanbul.*
27+
.*/node_modules/handlebars.*
28+
.*/node_modules/markdown.*
29+
.*/node_modules/node-notifier.*
30+
.*/node_modules/npmconf.*
31+
.*/node_modules/prettier.*
32+
.*/node_modules/source-map.*
33+
.*/node_modules/travis.*
34+
.*/node_modules/uglify.*
35+
.*/node_modules/yargs.*
36+
37+
[include]
38+
39+
[libs]
40+
41+
[options]
42+
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
43+
esproposal.class_instance_fields=enable
44+
unsafe.enable_getters_and_setters=true

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
# Directory for instrumented libs generated by jscoverage/JSCover
12+
lib-cov
13+
14+
15+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
16+
.grunt
17+
18+
# node-waf configuration
19+
.lock-wscript
20+
21+
# Compiled binary addons (http://nodejs.org/api/addons.html)
22+
build/Release
23+
24+
# IntelliJ Files
25+
*.iml
26+
*.ipr
27+
*.iws
28+
/out/
29+
.idea/
30+
.idea_modules/
31+
32+
# Dependency directory
33+
node_modules
34+
35+
# Optional npm cache directory
36+
.npm
37+
38+
# Optional REPL history
39+
.node_repl_history
40+
41+
# Transpiled code
42+
/es
43+
/lib
44+
45+
coverage
46+
.nyc_output

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
*.log
3+
src
4+
example

.travis.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
sudo: false
2+
language: node_js
3+
cache:
4+
yarn: true
5+
directories:
6+
- node_modules
7+
notifications:
8+
email: true
9+
node_js:
10+
- "8"
11+
- "7"
12+
- "6"
13+
before_install: yarn global add greenkeeper-lockfile@1
14+
before_script: greenkeeper-lockfile-update
15+
after_script: greenkeeper-lockfile-upload
16+
script:
17+
- yarn run test
18+
- yarn run build
19+
after_success:
20+
- 'curl -Lo travis_after_all.py https://git.io/travis_after_all'
21+
- python travis_after_all.py
22+
- export $(cat .to_export_back) &> /dev/null
23+
- if [[ "$TRAVIS_JOB_NUMBER" == *.1 && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then bash <(curl -s https://codecov.io/bash); fi
24+
- if [[ "$TRAVIS_JOB_NUMBER" == *.1 && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run semantic-release; fi
25+
branches:
26+
except:
27+
- /^v\d+\.\d+\.\d+$/

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.0-semantically-released (November 29, 2017)
2+
This package publishing automated by [semantic-release](https://github.com/semantic-release/semantic-release).
3+
[Changelog](https://github.com/graphql-compose/graphql-compose-aws/releases) is generated automatically and can be found here: https://github.com/graphql-compose/graphql-compose-aws/releases

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017-present Pavel Chertorogov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[WIP] graphql-compose-aws
2+
======================
3+
4+
[![](https://img.shields.io/npm/v/graphql-compose-aws.svg)](https://www.npmjs.com/package/graphql-compose-aws)
5+
[![npm](https://img.shields.io/npm/dt/graphql-compose-aws.svg)](http://www.npmtrends.com/graphql-compose-aws)
6+
[![Travis](https://img.shields.io/travis/graphql-compose/graphql-compose-aws.svg?maxAge=2592000)](https://travis-ci.org/graphql-compose/graphql-compose-aws)
7+
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
8+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
9+
[![Greenkeeper badge](https://badges.greenkeeper.io/graphql-compose/graphql-compose-aws.svg)](https://greenkeeper.io/)
10+
11+
This module expose AWS SDK API via GraphQL.
12+
13+
## AWS SDK GraphQL
14+
15+
Supported all AWS SDK versions that support official [aws-sdk](https://github.com/aws/aws-sdk-js) client. Internally it parses api schema files and generates all available methods with params and descriptions to GraphQL Field Config Map. You may put this config map to any GraphQL Schema.
16+
17+
```js
18+
import { GraphQLSchema, GraphQLObjectType } from 'graphql';
19+
import elasticsearch from 'elasticsearch';
20+
import { elasticApiFieldConfig } from 'graphql-compose-aws';
21+
22+
const schema = new GraphQLSchema({
23+
query: new GraphQLObjectType({
24+
name: 'Query',
25+
fields: {
26+
elastic50: elasticApiFieldConfig(
27+
// you may provide existed Elastic Client instance
28+
new elasticsearch.Client({
29+
host: 'http://localhost:9200',
30+
apiVersion: '5.0',
31+
})
32+
),
33+
34+
// or may provide just config
35+
elastic24: elasticApiFieldConfig({
36+
host: 'http://user:pass@localhost:9200',
37+
apiVersion: '2.4',
38+
}),
39+
40+
elastic17: elasticApiFieldConfig({
41+
host: 'http://user:pass@localhost:9200',
42+
apiVersion: '1.7',
43+
}),
44+
},
45+
}),
46+
});
47+
```
48+
49+
Full [code example](https://github.com/graphql-compose/graphql-compose-aws/tree/master/examples/)
50+
51+
Live demo of [Introspection of AWS SDK API via Graphiql](https://graphql-compose.herokuapp.com/aws/)
52+
53+
## Installation
54+
```
55+
yarn add graphql graphql-compose aws-sdk graphql-compose-aws
56+
// or
57+
npm install graphql graphql-compose aws-sdk graphql-compose-aws --save
58+
```
59+
Modules `graphql`, `graphql-compose`, `aws-sdk` are in `peerDependencies`, so should be installed explicitly in your app.
60+
61+
## Screenshots
62+
63+
### API proxy: Raw search method
64+
<img width="1316" alt="screen shot 2017-03-07 at 22 26 17" src="https://cloud.githubusercontent.com/assets/1946920/23859886/61066f40-082f-11e7-89d0-8443aa2ae930.png">
65+
66+
### API proxy: Getting several raw elastic metric in one request
67+
<img width="1314" alt="screen shot 2017-03-07 at 22 34 01" src="https://cloud.githubusercontent.com/assets/1946920/23859892/65e71744-082f-11e7-8c1a-cafeb87e08e6.png">
68+
69+
### Mapping: Relay Cursor Connection
70+
<img width="1411" alt="screen shot 2017-03-22 at 19 34 09" src="https://cloud.githubusercontent.com/assets/1946920/24200219/a058c220-0f36-11e7-9cf1-38394052f922.png">
71+
72+
### Mapping: Generated GraphQL Types and Documentation
73+
<img width="1703" alt="screen shot 2017-03-22 at 19 33 24" src="https://cloud.githubusercontent.com/assets/1946920/24200220/a05944b6-0f36-11e7-9919-39b7001af203.png">
74+
75+
76+
## License
77+
[MIT](https://github.com/graphql-compose/graphql-compose-aws/blob/master/LICENSE.md)

0 commit comments

Comments
 (0)