Skip to content

Commit

Permalink
v0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Le Cam committed Apr 24, 2017
1 parent 1fa3f3e commit de7096d
Show file tree
Hide file tree
Showing 8 changed files with 1,652 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.5.0 (2017-04-24)

Add `cookie` option, [PR #2](https://github.com/thusfresh/graphql-fetch-schema/pull/2) by [securingsincity](https://github.com/securingsincity)

## v0.4.0 (2017-01-25)

Update GraphQL to v0.9.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ graphql-fetch-schema <url> [options]
```
-h, --help output usage information
-V, --version output the version number
-c, --cookie pass additional Cookie header
-g, --graphql write schema.graphql file
-j, --json write schema.json file
-c, --cookie pass additional Cookie header
-o, --output <directory> write to specified directory
-s, --sort sort field keys
```
Expand Down
2 changes: 1 addition & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var run = function () {
};
}();

_commander2.default.version('0.4.0').usage('<url> [options]').option('-g, --graphql', 'write schema.graphql file').option('-c, --cookie <cookie>', 'pass additional Cookie header').option('-j, --json', 'write schema.json file').option('-o, --output <directory>', 'write to specified directory').option('-s, --sort', 'sort field keys').parse(process.argv);
_commander2.default.version('0.5.0').usage('<url> [options]').option('-g, --graphql', 'write schema.graphql file').option('-c, --cookie <cookie>', 'pass additional Cookie header').option('-j, --json', 'write schema.json file').option('-o, --output <directory>', 'write to specified directory').option('-s, --sort', 'sort field keys').parse(process.argv);

run(_commander2.default.args[0], {
graphql: !!_commander2.default.graphql,
Expand Down
1 change: 0 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ exports.default = function () {
'Content-Type': 'application/json'
};


if (options.cookie) {
headers['Cookie'] = options.cookie;
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphql-fetch-schema",
"version": "0.4.0",
"version": "0.5.0",
"description": "Fetch a GraphQL schema from a server and write it to file",
"repository": {
"type": "git",
Expand All @@ -15,7 +15,7 @@
"compile": "babel src --out-dir lib",
"build": "npm run clean && npm run compile",
"start": "npm run build",
"prepublish": "npm ls && npm start"
"prepublish": "npm start"
},
"author": "Paul Le Cam <[email protected]>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const run = async (url: string, options: Object) => {
}

program
.version('0.4.0')
.version('0.5.0')
.usage('<url> [options]')
.option('-g, --graphql', 'write schema.graphql file')
.option('-c, --cookie <cookie>', 'pass additional Cookie header')
Expand Down
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,15 @@ export default async (url: string, options: Options = {}) => {
options.json = true
}
const pathPrefix = options.outputPath || './'

const headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
}

if (options.cookie) {
headers['Cookie'] = options.cookie
}


const res = await fetch(url, {
method: 'POST',
headers: headers,
Expand Down
Loading

0 comments on commit de7096d

Please sign in to comment.