@deboxsoft/module-core
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -57,10 +57,13 @@ 'use strict'; | ||
const createFetchGraphql = (options, persisted = true) => { | ||
const request = new graphqlRequest.GraphQLClient(options.url, options); | ||
const request2 = new graphqlRequest.GraphQLClient(options.url, options); | ||
if (persisted) { | ||
Container__default['default'].set(graphqlRequest.GraphQLClient, request); | ||
Container__default['default'].set(graphqlRequest.GraphQLClient, request2); | ||
} | ||
return request; | ||
return request2; | ||
}; | ||
const getFetchGraphql = () => Container__default['default'].get(graphqlRequest.GraphQLClient); | ||
const fetchGraphql = (query, variables) => getFetchGraphql().request(query, variables); | ||
const gql = graphqlRequest.gql; | ||
const rawRequestGraphql = graphqlRequest.rawRequest; | ||
const requestGraphql = graphqlRequest.request; | ||
@@ -81,5 +84,8 @@ Object.keys(Container).forEach(function (k) { | ||
exports.getLogger = getLogger; | ||
exports.gql = gql; | ||
exports.rawRequestGraphql = rawRequestGraphql; | ||
exports.registerLogger = registerLogger; | ||
exports.requestGraphql = requestGraphql; | ||
exports.tokenLogger = tokenLogger; | ||
exports.utils = index; | ||
//# sourceMappingURL=index.cjs.js.map |
import { Token } from 'typedi'; | ||
export * from 'typedi'; | ||
import { GraphQLClient } from 'graphql-request'; | ||
import { GraphQLClient, gql as gql$1, rawRequest, request } from 'graphql-request'; | ||
import { RequestInit } from 'graphql-request/dist/types.dom'; | ||
@@ -96,3 +97,3 @@ declare const generateId: (size?: number) => string; | ||
declare type GraphqlRequestOptions = { | ||
declare type GraphqlRequestOptions = RequestInit & { | ||
url: string; | ||
@@ -103,3 +104,6 @@ }; | ||
declare const fetchGraphql: <V>(query: string, variables?: V | undefined) => Promise<any>; | ||
declare const gql: typeof gql$1; | ||
declare const rawRequestGraphql: typeof rawRequest; | ||
declare const requestGraphql: typeof request; | ||
export { DeboxError, Logger, Maybe, createFetchGraphql, fetchGraphql, getFetchGraphql, getLogger, registerLogger, tokenLogger, index as utils }; | ||
export { DeboxError, Logger, Maybe, createFetchGraphql, fetchGraphql, getFetchGraphql, getLogger, gql, rawRequestGraphql, registerLogger, requestGraphql, tokenLogger, index as utils }; |
import Container__default, { Token } from 'typedi'; | ||
export * from 'typedi'; | ||
import { nanoid } from 'nanoid'; | ||
import { GraphQLClient } from 'graphql-request'; | ||
import { GraphQLClient, gql as gql$1, rawRequest, request } from 'graphql-request'; | ||
@@ -50,12 +50,15 @@ const generateId = nanoid; | ||
const createFetchGraphql = (options, persisted = true) => { | ||
const request = new GraphQLClient(options.url, options); | ||
const request2 = new GraphQLClient(options.url, options); | ||
if (persisted) { | ||
Container__default.set(GraphQLClient, request); | ||
Container__default.set(GraphQLClient, request2); | ||
} | ||
return request; | ||
return request2; | ||
}; | ||
const getFetchGraphql = () => Container__default.get(GraphQLClient); | ||
const fetchGraphql = (query, variables) => getFetchGraphql().request(query, variables); | ||
const gql = gql$1; | ||
const rawRequestGraphql = rawRequest; | ||
const requestGraphql = request; | ||
export { DeboxError, Logger, createFetchGraphql, fetchGraphql, getFetchGraphql, getLogger, registerLogger, tokenLogger, index as utils }; | ||
export { DeboxError, Logger, createFetchGraphql, fetchGraphql, getFetchGraphql, getLogger, gql, rawRequestGraphql, registerLogger, requestGraphql, tokenLogger, index as utils }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@deboxsoft/module-core", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"license": "SEE LICENSE IN LICENSE", | ||
@@ -28,2 +28,3 @@ "maintainers": [ | ||
"change-case": "^4.1.1", | ||
"graphql-request": "3.3.0", | ||
"nanoid": "^3.1.12", | ||
@@ -38,3 +39,3 @@ "typedi": "0.8.0" | ||
}, | ||
"gitHead": "815f1526223582aad27ea1916d3a825f5b89e50a" | ||
"gitHead": "b3e9a01fe218a03c99900e51a67ea119b92324e1" | ||
} |
@@ -1,5 +0,6 @@ | ||
import { GraphQLClient as GraphqlRequest } from "graphql-request"; | ||
import { GraphQLClient as GraphqlRequest, gql as _gql, rawRequest, request } from "graphql-request"; | ||
import { RequestInit } from "graphql-request/dist/types.dom"; | ||
import Container from "typedi"; | ||
type GraphqlRequestOptions = { | ||
type GraphqlRequestOptions = RequestInit & { | ||
url: string; | ||
@@ -20,1 +21,7 @@ }; | ||
getFetchGraphql().request(query, variables); | ||
export const gql = _gql; | ||
export const rawRequestGraphql = rawRequest; | ||
export const requestGraphql = request; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
244424
405
4
+ Addedgraphql-request@3.3.0
+ Addedasynckit@0.4.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcross-fetch@3.1.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedextract-files@9.0.0(transitive)
+ Addedform-data@3.0.2(transitive)
+ Addedgraphql@15.9.0(transitive)
+ Addedgraphql-request@3.3.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)