UNPKG

rtk-query-graphql

Version:

It helps you to make queries to a server that is using graphql

3 lines (2 loc) 859 B
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("graphql-request")):"function"==typeof define&&define.amd?define(["exports","graphql-request"],r):r((e||self).graphql={},e.graphqlRequest)}(this,function(e,r){e.graphqlFetch=function(e){var t="client"in e?e.client:new r.GraphQLClient(e.url);return e.prepareHeaders&&e.prepareHeaders(t.setHeaders,t.setHeader),function(e){var n=e.document,s=e.variables;try{return Promise.resolve(function(e,r){try{var a=Promise.resolve(t.request(n,s)).then(function(e){return{data:e,meta:{}}})}catch(e){return r(e)}return a&&a.then?a.then(void 0,r):a}(0,function(e){if(e instanceof r.ClientError)return{error:{name:e.name,message:e.message,stack:e.stack},meta:{request:e.request,response:e.response}};throw e}))}catch(e){return Promise.reject(e)}}}}); //# sourceMappingURL=index.umd.js.map