1 | import { transport } from './utils/transport.js';
|
2 |
|
3 | /**
|
4 | * [reachGraphQL Makes queres or mutations against GraphQL]
|
5 | * @param {[String]} path [path to the GraphQL server]
|
6 | * @param {[Object]} query [The query that GraphQL will use to fetch your data]
|
7 | * @param {[object]} queryParams = {} [Should contain object with different query params]
|
8 | * @return {[Object]} [Data that was queried or mutated]
|
9 | */
|
10 |
|
11 | export function reachGraphQL (path, query, queryParams = {}, token) {
|
12 | return transport(path, query, queryParams, token).then((res) => {
|
13 | return res;
|
14 | });
|
15 | }
|