Skip to content

charlypoly/generic-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

generic-graphql

Generic GraphQL Wrapper for Rest API


Design goal

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 ?

Releases

No releases published

Packages

No packages published