graphql-codegen-core
Advanced tools
Comparing version 0.8.4 to 0.8.5
@@ -17,2 +17,3 @@ "use strict"; | ||
var debugging_1 = require("../debugging"); | ||
var resolve_type_indicators_1 = require("../schema/resolve-type-indicators"); | ||
function separateSelectionSet(selectionSet) { | ||
@@ -45,3 +46,5 @@ var fields = selectionSet.filter(function (n) { return types_1.isFieldNode(n); }); | ||
var childSelectionSet = buildSelectionSet(schema, graphql_1.getNamedType(field.type), fieldNode.selectionSet); | ||
return __assign({ isField: true, isFragmentSpread: false, isInlineFragment: false, isLeaf: childSelectionSet.length === 0, name: name, selectionSet: childSelectionSet }, separateSelectionSet(childSelectionSet), { type: resolvedType.name, isRequired: resolvedType.isRequired, isArray: resolvedType.isArray }); | ||
var namedType = graphql_1.getNamedType(field.type); | ||
var indicators = resolve_type_indicators_1.resolveTypeIndicators(namedType); | ||
return __assign({ isField: true, isFragmentSpread: false, isInlineFragment: false, isLeaf: childSelectionSet.length === 0, name: name, selectionSet: childSelectionSet }, separateSelectionSet(childSelectionSet), { type: resolvedType.name, isRequired: resolvedType.isRequired, isArray: resolvedType.isArray, isEnum: indicators.isEnum, isScalar: indicators.isScalar, isInterface: indicators.isInterface, isUnion: indicators.isUnion, isInputType: indicators.isInputType, isType: indicators.isType }); | ||
} | ||
@@ -48,0 +51,0 @@ else if (selectionNode.kind === kinds_1.FRAGMENT_SPREAD) { |
@@ -6,2 +6,3 @@ "use strict"; | ||
var debugging_1 = require("../debugging"); | ||
var resolve_type_indicators_1 = require("../schema/resolve-type-indicators"); | ||
function transformVariables(schema, definitionNode) { | ||
@@ -12,2 +13,4 @@ return definitionNode.variableDefinitions.map(function (variableDefinition) { | ||
debugging_1.debugLog("[transformVariables] transforming variable " + variableDefinition.variable.name.value + " of type " + resolvedType.name); | ||
var namedType = graphql_1.getNamedType(typeFromSchema); | ||
var indicators = resolve_type_indicators_1.resolveTypeIndicators(namedType); | ||
return { | ||
@@ -18,2 +21,8 @@ name: variableDefinition.variable.name.value, | ||
isRequired: resolvedType.isRequired, | ||
isEnum: indicators.isEnum, | ||
isScalar: indicators.isScalar, | ||
isInterface: indicators.isInterface, | ||
isUnion: indicators.isUnion, | ||
isInputType: indicators.isInputType, | ||
isType: indicators.isType, | ||
}; | ||
@@ -20,0 +29,0 @@ }); |
@@ -11,3 +11,3 @@ "use strict"; | ||
isUnion: namedType['resolveType'] !== undefined && namedType['getTypes'] !== undefined, | ||
isInputType: namedType['getFields'] !== undefined && namedType['getInterfaces'] === undefined, | ||
isInputType: namedType['getFields'] !== undefined && namedType['getInterfaces'] === undefined && namedType['resolveType'] === undefined, | ||
isEnum: isEnum, | ||
@@ -14,0 +14,0 @@ }; |
@@ -116,2 +116,8 @@ import { GraphQLSchema } from 'graphql'; | ||
hasFields: boolean; | ||
isType: boolean; | ||
isScalar: boolean; | ||
isInterface: boolean; | ||
isUnion: boolean; | ||
isInputType: boolean; | ||
isEnum: boolean; | ||
} | ||
@@ -155,2 +161,8 @@ export declare function isFieldNode(node: SelectionSetItem): node is SelectionSetFieldNode; | ||
isArray: boolean; | ||
isType: boolean; | ||
isScalar: boolean; | ||
isInterface: boolean; | ||
isUnion: boolean; | ||
isInputType: boolean; | ||
isEnum: boolean; | ||
} | ||
@@ -157,0 +169,0 @@ export interface Document { |
{ | ||
"name": "graphql-codegen-core", | ||
"version": "0.8.4", | ||
"version": "0.8.5", | ||
"description": "GraphQL types and code generator based on schema", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
141585
1002