@jumpn/utils-graphql
Advanced tools
Comparing version 0.3.1 to 0.4.0
@@ -18,3 +18,3 @@ 'use strict'; | ||
/** | ||
* Returns the type of the given operation | ||
* Returns the type (query, mutation, or subscription) of the given operation | ||
* | ||
@@ -41,5 +41,9 @@ * @example | ||
return result ? getOperationTypeFromMatched(result[1]) : undefined; | ||
if (!result) { | ||
throw new TypeError("Invalid operation:\n" + String(operation)); | ||
} | ||
return getOperationTypeFromMatched(result[1]); | ||
}.bind(undefined); | ||
module.exports = getOperationType; |
@@ -67,3 +67,3 @@ 'use strict'; | ||
/** | ||
* Returns the type of the given operation | ||
* Returns the type (query, mutation, or subscription) of the given operation | ||
* | ||
@@ -90,3 +90,7 @@ * @example | ||
return result ? getOperationTypeFromMatched(result[1]) : undefined; | ||
if (!result) { | ||
throw new TypeError("Invalid operation:\n" + String(operation)); | ||
} | ||
return getOperationTypeFromMatched(result[1]); | ||
}.bind(undefined); | ||
@@ -93,0 +97,0 @@ |
@@ -87,3 +87,3 @@ (function (global, factory) { | ||
/** | ||
* Returns the type of the given operation | ||
* Returns the type (query, mutation, or subscription) of the given operation | ||
* | ||
@@ -110,3 +110,7 @@ * @example | ||
return result ? getOperationTypeFromMatched(result[1]) : undefined; | ||
if (!result) { | ||
throw new TypeError("Invalid operation:\n" + String(operation)); | ||
} | ||
return getOperationTypeFromMatched(result[1]); | ||
}.bind(undefined); | ||
@@ -113,0 +117,0 @@ |
@@ -14,3 +14,3 @@ import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck'; | ||
/** | ||
* Returns the type of the given operation | ||
* Returns the type (query, mutation, or subscription) of the given operation | ||
* | ||
@@ -37,5 +37,9 @@ * @example | ||
return result ? getOperationTypeFromMatched(result[1]) : undefined; | ||
if (!result) { | ||
throw new TypeError("Invalid operation:\n" + String(operation)); | ||
} | ||
return getOperationTypeFromMatched(result[1]); | ||
}.bind(undefined); | ||
export default getOperationType; |
@@ -61,3 +61,3 @@ import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck'; | ||
/** | ||
* Returns the type of the given operation | ||
* Returns the type (query, mutation, or subscription) of the given operation | ||
* | ||
@@ -84,5 +84,9 @@ * @example | ||
return result ? getOperationTypeFromMatched(result[1]) : undefined; | ||
if (!result) { | ||
throw new TypeError("Invalid operation:\n" + String(operation)); | ||
} | ||
return getOperationTypeFromMatched(result[1]); | ||
}.bind(undefined); | ||
export { errorsToString, getOperationType }; |
{ | ||
"name": "@jumpn/utils-graphql", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "GraphQL utilities", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.js", |
@@ -88,3 +88,3 @@ # @jumpn/utils-graphql | ||
Returns the type of the given operation | ||
Returns the type (query, mutation, or subscription) of the given operation | ||
@@ -112,3 +112,3 @@ **Parameters** | ||
Returns **(void | GqlOperationType)** | ||
Returns **GqlOperationType** | ||
@@ -115,0 +115,0 @@ ## License |
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
23451
391