Skip to content

Commit d48c3b8

Browse files
committed
refactor to use es6/7, fix yarax#22
1 parent 601ac79 commit d48c3b8

11 files changed

+3978
-101
lines changed

.babelrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015", "stage-0"]
3+
}

.flowconfig

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[ignore]
2+
3+
[include]
4+
5+
[libs]
6+
7+
[options]

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ npm-debug.log
2424
dump.rdb
2525
bundle.js
2626

27-
dist
27+
lib
2828
coverage
2929
.nyc_output
3030
flow-coverage

example.js example/example.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
require('babel-polyfill');
12
const express = require('express');
23
const app = express();
34
var graphqlHTTP = require('express-graphql');
45
var graphql = require('graphql');
5-
var graphQLSchema = require('./lib');
6+
var graphQLSchema = require('swagger-to-graphql').default;
67

7-
graphQLSchema('./test/fixtures/petstore.json').then(schema => {
8+
graphQLSchema('../test/fixtures/petstore.json').then(schema => {
89
app.use('/graphql', graphqlHTTP(() => {
910
return {
1011
schema,

example/package.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "swagger-example",
3+
"version": "1.0.0",
4+
"license": "MIT",
5+
"main": "index.js",
6+
"scripts": {
7+
"start": "node example.js"
8+
},
9+
"dependencies": {
10+
"babel-polyfill": "^6.23.0",
11+
"express": "^4.15.3",
12+
"express-graphql": "^0.6.6",
13+
"graphql": "^0.10.1",
14+
"swagger-to-graphql": "../."
15+
}
16+
}

0 commit comments

Comments
 (0)