Simple GraphQL Client
Simple, zero dependencies GraphQL client for the Web and Node.js
How to install
npm install --save simple-graphql-client
Polyfills
Altough simple-graphql-client
has no dependencies, it need fetch
and Promise
functions in the global scope to work.
Sample usage
ES5:
var client = var query =
ES2015:
const query =
ES7
const query = const response = await console
Syntax
client
client(url, [options])
url
: String, required. The URL of the GraphQL server.options
: Object, optional.headers
: Object, optional. An object with the headers that will be passed to the server.
query
query(query, variables)
query
: String, required. A valid GraphQL query.variables
: Object, optinal. An object with the variables that will be passed in the query.
Contributing
If you find an error, create an issue or submit a PR with the fix.