smallorange-graphql-mux

1.0.7 • Public • Published

CircleCI

Usage

	const http = json => fetch('http://yourGraphQLEndpoint.com', {
		method: 'POST',
		cache: 'no-store',
		headers: {
			'content-type': 'application/json'
		},
		body: JSON.stringify(json)
	});
	
	const queue = new GraphQLMux(http, 'query', 10);
	
	queue.graphql({
		requestString: `query($user: String!) {
			user(id: $user) {
				name
			}
		}`,
		variableValues: {
			user: 'user'
		}
	})
	.then(...);
	
	queue.graphql({
		requestString: `query(order: String!) {
			order(id: $order) {
				date
				total
			}
		}`,
		variableValues: {
			order: 'order'
		}
	})
	.then(...);

Readme

Keywords

none

Package Sidebar

Install

npm i smallorange-graphql-mux

Weekly Downloads

7

Version

1.0.7

License

MIT

Unpacked Size

46.3 kB

Total Files

7

Last publish

Collaborators

  • feliperohde