diff --git a/.gitignore b/.gitignore index 10d0bf3..8bc9167 100644 --- a/.gitignore +++ b/.gitignore @@ -1,39 +1,7 @@ -lib - -# Logs -logs +node_modules *.log -npm-debug.log* - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul +.DS_Store +lib coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules -jspm_packages - -# Optional npm cache directory -.npm - -# Optional REPL history -.node_repl_history +.idea +npm-debug.log diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..114ac0b --- /dev/null +++ b/.npmignore @@ -0,0 +1,7 @@ +.DS_Store +*.log +src +test +examples +coverage +node_modules diff --git a/README.md b/README.md index 06db4d0..80b2329 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # apollo-upload-network-interface -UploadNetworkInterface for Apollo GraphQL Client + +UploadNetworkInterface for Apollo GraphQL Client. Adds support for `multipart/form-data` requests. + +Used together with [graphql-server-express-upload](https://github.com/HriBB/graphql-server-express-upload) and [graphql-server-koa-upload](https://github.com/HriBB/graphql-server-koa-upload) (coming soon). + +_Any help is appreciated!_ ## Usage @@ -8,14 +13,15 @@ import ApolloClient from 'apollo-client' import createNetworkInterface from 'apollo-upload-network-interface' const networkInterface = createNetworkInterface({ - uri: config.graphql.url, + uri: '/graphql', }) -export default new ApolloClient({ +const client = new ApolloClient({ networkInterface }) ``` ## TODO -- [ ] Add some tests +- [ ] Add tests +- [ ] Convert to typescript diff --git a/package.json b/package.json index 41351ff..5745607 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,9 @@ "semantic-release": "semantic-release pre && npm publish && semantic-release post", "test": "mocha ./test/setup.js" }, + "files": [ + "lib" + ], "repository": { "type": "git", "url": "https://github.com/HriBB/apollo-upload-network-interface.git"