gql-types-generator
Advanced tools
Comparing version 1.4.6 to 1.4.7
@@ -176,5 +176,5 @@ "use strict"; | ||
if (node.kind === 'OperationDefinition') { | ||
var name = node.name, operation = node.operation; | ||
var ts = utils_1.generateOperation(utils_1.parseOperationDefinitionNode(node, schema, operations), schemaFileName, wrapWithTag); | ||
acc.push({ operationName: name.value + utils_1.toCamelCase(operation), ts: ts }); | ||
var parsed = utils_1.parseOperationDefinitionNode(node, schema, operations); | ||
var ts = utils_1.generateOperation(parsed, schemaFileName, wrapWithTag); | ||
acc.push({ operationName: parsed.name, ts: ts }); | ||
} | ||
@@ -181,0 +181,0 @@ return acc; |
@@ -77,2 +77,9 @@ import { CompiledTypeName, GQLScalarType, DisplayType, GraphQLNonWrappedType, DefinitionWithImportTypes } from '../types'; | ||
/** | ||
* Returns compiled operation namespace name | ||
* @param {string} name | ||
* @param {string} operation | ||
* @returns {string} | ||
*/ | ||
export declare function getCompiledOperationNamespaceName(name: string, operation: string): string; | ||
/** | ||
* Returns operation root node depending on operation type | ||
@@ -79,0 +86,0 @@ * @param {GraphQLSchema} schema |
@@ -206,6 +206,16 @@ "use strict"; | ||
function getCompiledOperationName(name, operation) { | ||
return toCamelCase(name) + toCamelCase(operation); | ||
return name + toCamelCase(operation); | ||
} | ||
exports.getCompiledOperationName = getCompiledOperationName; | ||
/** | ||
* Returns compiled operation namespace name | ||
* @param {string} name | ||
* @param {string} operation | ||
* @returns {string} | ||
*/ | ||
function getCompiledOperationNamespaceName(name, operation) { | ||
return toCamelCase(name) + toCamelCase(operation); | ||
} | ||
exports.getCompiledOperationNamespaceName = getCompiledOperationNamespaceName; | ||
/** | ||
* Returns operation root node depending on operation type | ||
@@ -212,0 +222,0 @@ * @param {GraphQLSchema} schema |
@@ -348,2 +348,3 @@ "use strict"; | ||
var operationName = misc_1.getCompiledOperationName(name.value, operation); | ||
var operationNamespaceName = misc_1.getCompiledOperationNamespaceName(name.value, operation); | ||
var rootNode = misc_1.getOperationRootNode(schema, operation); | ||
@@ -359,3 +360,3 @@ var importTypes = []; | ||
name: operationName, | ||
fields: selectionSetToObjectFields(selectionSet, operationName), | ||
fields: selectionSetToObjectFields(selectionSet, operationNamespaceName), | ||
}; | ||
@@ -366,3 +367,3 @@ // Arguments | ||
// Namespace | ||
var namespace = selectionSetToRootNamespace(selectionSet, operationName, args, rootNode); | ||
var namespace = selectionSetToRootNamespace(selectionSet, operationNamespaceName, args, rootNode); | ||
addImportTypes(namespace.importTypes); | ||
@@ -369,0 +370,0 @@ return { |
{ | ||
"name": "gql-types-generator", | ||
"version": "1.4.6", | ||
"version": "1.4.7", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
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
86614
1973