Skip to content

Commit eb499c5

Browse files
committed
docs: update readme
1 parent cc9cadf commit eb499c5

File tree

4 files changed

+4010
-11610
lines changed

4 files changed

+4010
-11610
lines changed

README.md

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[WIP] graphql-compose-aws
2-
======================
1+
graphql-compose-aws
2+
===================
33

44
[![](https://img.shields.io/npm/v/graphql-compose-aws.svg)](https://www.npmjs.com/package/graphql-compose-aws)
55
[![npm](https://img.shields.io/npm/dt/graphql-compose-aws.svg)](http://www.npmtrends.com/graphql-compose-aws)
@@ -10,45 +10,40 @@
1010

1111
This module expose AWS SDK API via GraphQL.
1212

13+
#### Live demo of [AWS SDK API via Graphiql](https://graphql-compose.herokuapp.com/aws/)
14+
Generated Schema Introspection in SDL format can be found [here](https://raw.githubusercontent.com/graphql-compose/graphql-compose-aws/master/examples/introspection/schema.txt) (more than 10k types, ~2MB).
15+
1316
## AWS SDK GraphQL
1417

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.
18+
Supported all AWS SDK versions via official [aws-sdk](https://github.com/aws/aws-sdk-js) js client. Internally it generates Types and FieldConfigs from AWS SDK configs. You may put this generated types to any GraphQL Schema.
1619

1720
```js
1821
import { GraphQLSchema, GraphQLObjectType } from 'graphql';
19-
import elasticsearch from 'elasticsearch';
20-
import { elasticApiFieldConfig } from 'graphql-compose-aws';
22+
import awsSDK from 'aws-sdk';
23+
import { AwsApiParser } from 'graphql-compose-aws';
24+
25+
const awsApiParser = new AwsApiParser({
26+
awsSDK,
27+
});
2128

2229
const schema = new GraphQLSchema({
2330
query: new GraphQLObjectType({
2431
name: 'Query',
2532
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-
}),
33+
// Full API
34+
aws: awsApiParser.getFieldConfig(),
35+
36+
// Partial API with desired services
37+
s3: awsApiParser.getService('s3').getFieldConfig(),
38+
ec2: awsApiParser.getService('ec2').getFieldConfig(),
4439
},
4540
}),
4641
});
47-
```
4842

49-
Full [code example](https://github.com/graphql-compose/graphql-compose-aws/tree/master/examples/)
43+
export default schema;
44+
```
5045

51-
Live demo of [Introspection of AWS SDK API via Graphiql](https://graphql-compose.herokuapp.com/aws/)
46+
Full [code examples](https://github.com/graphql-compose/graphql-compose-aws/tree/master/examples/)
5247

5348
## Installation
5449
```
@@ -60,17 +55,11 @@ Modules `graphql`, `graphql-compose`, `aws-sdk` are in `peerDependencies`, so sh
6055

6156
## Screenshots
6257

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">
58+
### Get List of EC2 instances from `eu-west-1` region
59+
<img width="1185" alt="screen shot 2017-12-03 at 18 19 28" src="https://user-images.githubusercontent.com/1946920/33525931-c7092c7a-d862-11e7-947b-70380693cc8b.png">
7160

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">
61+
### Several requests in one query with different services and regions
62+
<img width="1184" alt="screen shot 2017-12-03 at 18 07 50" src="https://user-images.githubusercontent.com/1946920/33525932-c8507656-d862-11e7-9e66-4deb27b8f996.png">
7463

7564

7665
## License

0 commit comments

Comments
 (0)