This repository has been archived by the owner on Jun 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a2cc9ef
Showing
14 changed files
with
10,832 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"presets": [["env", { "targets": { "node": "8.6" } }], "stage-2"], | ||
"env": { | ||
"development": { | ||
"sourceMaps": "inline" | ||
}, | ||
"commonjs": { | ||
"presets": [ | ||
[ | ||
"env", | ||
{ | ||
"targets": { "browsers": ["last 2 versions"] }, | ||
"loose": true | ||
} | ||
], | ||
"stage-2" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
lib/* | ||
node_modules/* | ||
es/* | ||
# webpack.*.js | ||
# webpack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
extends: 'dacz', | ||
rules: {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# my own | ||
archive | ||
|
||
# logs | ||
log/* | ||
temp/* | ||
|
||
# npm | ||
node_modules | ||
lib | ||
|
||
# coverage | ||
coverage | ||
.nyc_output | ||
coverage.lcov | ||
|
||
# others | ||
ssh | ||
|
||
# Mess by os | ||
Thumbs.db | ||
ehthumbs.db | ||
Desktop.ini | ||
$RECYCLE.BIN/ | ||
*.cab | ||
*.msi | ||
*.msm | ||
*.msp | ||
*.lnk | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
Icon | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
# Docker | ||
.data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
language: node_js | ||
cache: | ||
directories: | ||
- node_modules | ||
notifications: | ||
email: false | ||
node_js: | ||
- '8' | ||
before_install: | ||
- npm install -g greenkeeper-lockfile@1 | ||
before_script: | ||
- npm prune | ||
- greenkeeper-lockfile-update | ||
script: | ||
- npm run lint | ||
- npm run test | ||
- npm run build | ||
after_script: greenkeeper-lockfile-upload | ||
after_success: | ||
- npm run semantic-release | ||
- npm run report-coverage | ||
branches: | ||
only: | ||
- master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2017 David Cizek | ||
|
||
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: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Apollo Bridge Link | ||
|
||
When you don't have GraphQL server (yet) and want to use GraphQL on the client. | ||
|
||
Use your own resolvers to non-graphql endpoints (like REST API etc.). | ||
|
||
[![current version](https://img.shields.io/npm/v/apollo-bridge-link.svg?style=flat-square)](https://www.npmjs.com/package/apollo-bridge-link) | ||
[![travis.ci](https://img.shields.io/travis/dacz/apollo-bridge-link.svg?style=flat-square)](https://travis-ci.org/dacz/apollo-bridge-link) | ||
[![codecov](https://codecov.io/gh/dacz/apollo-bridge-link/branch/master/graph/badge.svg)](https://codecov.io/gh/dacz/apollo-bridge-link) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/dacz/apollo-bridge-link.svg)](https://greenkeeper.io/) | ||
|
||
|
||
## Idea | ||
|
||
GraphQL client side development is great experience. But more then often company doen't have GraphQL server (yet). Bridge allows you to resolve GraphQL queries and mutations the way you want (facing REST API eg.) | ||
|
||
Allows gradual implementing of GraphQL within your project and doesn't require to change backend. Schema created along the way will be corner stone for full adoption of GraphQL. | ||
|
||
|
||
## Implementation | ||
|
||
We created this tool for us to deliver web and native app. We use Apollo tools and therefore this is implemented as Apollo Link. Because Apollo client v2.0 and Apollo Link etc. is still wip (and moving target), this is experimental. | ||
|
||
The basic implementation is simple: this link allows you to create link that accepts your schema and your resolvers. You can even mock the schema on the client. | ||
|
||
The tools for easily facing eg. REST server will come. | ||
|
||
## How to use | ||
|
||
### Install | ||
|
||
``` | ||
npm install apollo-client@beta apollo-bridge-link apollo-cache-inmemory@beta | ||
``` | ||
|
||
### create Apollo client | ||
|
||
```javascript | ||
import ApolloClient from 'apollo-client'; | ||
import { BridgeLink } from 'apollo-bridge-link'; | ||
import InMemoryCache from 'apollo-cache-inmemory'; | ||
|
||
// your prepared schema (as txt or parsed) | ||
import schema from './schema'; | ||
|
||
// you resolvers | ||
import reolvers from './resolvers'; | ||
|
||
// if you want to mock anything in the schema (that has not resolver) | ||
const mock = true; | ||
|
||
// if you want to push something down to the resolvers in context | ||
const context = { | ||
graphQl: 'is cool' | ||
} | ||
|
||
export const client = new ApolloClient({ | ||
link: BridgeLink({ schema, resolvers, mock, context }); | ||
cache: new InMemoryCache({ addTypename: true }), | ||
}); | ||
``` | ||
|
||
... more details to come | ||
|
||
|
||
## Need help, want help? | ||
|
||
If you are developer, please submit issue or PR. | ||
|
||
If you are company and want to help with implementing GraphQL (server/web app/react native apps), hire us. We are passionate programmers (Node, React, ReactNative, GraphQl, ... ). | ||
|
||
## To Do | ||
|
||
* [ ] make example (against REST, with dataloader) | ||
|
||
## Sponsors | ||
|
||
**LiveAndCode** - passionate group of javascript developers (contact [email protected]). Thanks! |
Oops, something went wrong.