https://github.com/charlypoly/generic-graphql
Generic GraphQL Wrapper for Rest API
https://github.com/charlypoly/generic-graphql
graphql node-module rest-api typescript-library
Last synced: about 1 year ago
JSON representation
Generic GraphQL Wrapper for Rest API
- Host: GitHub
- URL: https://github.com/charlypoly/generic-graphql
- Owner: charlypoly
- License: mit
- Created: 2017-03-02T13:14:33.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-11T19:01:16.000Z (about 9 years ago)
- Last Synced: 2025-03-30T11:02:36.830Z (about 1 year ago)
- Topics: graphql, node-module, rest-api, typescript-library
- Size: 3.91 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# generic-graphql
> Generic GraphQL Wrapper for Rest API
--------------------
### Design goal
```typescript
let schema = `
type Artist {
id: String
name: String
popularity: Int
type: String
}
`;
let configuration = {
root: 'http://myapi.com/api/v1',
oAuth: false,
inferRessourceFromTypes: true,
generateQueries: true
};
let client: GenericGraphQLClient = new GenericGraphQL({
adapter: new GenericGraphQLCRUD(configuration)
});
let query = `{
query {
artist($id: 1) {
name
}
}
}`;
// call `http://myapi.com/api/v1/artists/1`
client.query(query, (executionResult) => {
});
```
#### Dependencies
- istanbul
- mocha
- request
- graphql-tools
- lodash ?
- when ?