graphql-codegen-core
Advanced tools
Comparing version 0.6.0-alpha.f56888d8 to 0.6.0-alpha.f5818070
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var graphql_1 = require("graphql"); | ||
var resolve_type_1 = require("./resolve-type"); | ||
var resolve_type_indicators_1 = require("./resolve-type-indicators"); | ||
function resolveArguments(args) { | ||
return args.map(function (arg) { | ||
var type = resolve_type_1.resolveType(arg.type); | ||
var namedType = graphql_1.getNamedType(arg.type); | ||
var indicators = resolve_type_indicators_1.resolveTypeIndicators(namedType); | ||
return { | ||
@@ -13,2 +17,8 @@ name: arg.name, | ||
isArray: type.isArray, | ||
isEnum: indicators.isEnum, | ||
isScalar: indicators.isScalar, | ||
isInterface: indicators.isInterface, | ||
isUnion: indicators.isUnion, | ||
isInputType: indicators.isInputType, | ||
isType: indicators.isType, | ||
}; | ||
@@ -15,0 +25,0 @@ }); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var graphql_1 = require("graphql"); | ||
var object_map_to_array_1 = require("../utils/object-map-to-array"); | ||
var resolve_type_1 = require("./resolve-type"); | ||
var resolve_arguments_1 = require("./resolve-arguments"); | ||
var resolve_type_indicators_1 = require("./resolve-type-indicators"); | ||
function resolveFields(rawFields) { | ||
@@ -11,2 +13,4 @@ var fieldsArray = object_map_to_array_1.objectMapToArray(rawFields); | ||
var resolvedArguments = resolve_arguments_1.resolveArguments(item.value.args || []); | ||
var namedType = graphql_1.getNamedType(item.value.type); | ||
var indicators = resolve_type_indicators_1.resolveTypeIndicators(namedType); | ||
return { | ||
@@ -20,2 +24,8 @@ name: item.value.name, | ||
hasArguments: resolvedArguments.length > 0, | ||
isEnum: indicators.isEnum, | ||
isScalar: indicators.isScalar, | ||
isInterface: indicators.isInterface, | ||
isUnion: indicators.isUnion, | ||
isInputType: indicators.isInputType, | ||
isType: indicators.isType, | ||
}; | ||
@@ -22,0 +32,0 @@ }); |
@@ -7,2 +7,8 @@ export interface Argument { | ||
isArray: boolean; | ||
isType: boolean; | ||
isScalar: boolean; | ||
isInterface: boolean; | ||
isUnion: boolean; | ||
isInputType: boolean; | ||
isEnum: boolean; | ||
} | ||
@@ -17,2 +23,8 @@ export interface Field { | ||
hasArguments: boolean; | ||
isType: boolean; | ||
isScalar: boolean; | ||
isInterface: boolean; | ||
isUnion: boolean; | ||
isInputType: boolean; | ||
isEnum: boolean; | ||
} | ||
@@ -76,6 +88,8 @@ export interface Type { | ||
onType: string; | ||
fragmentsSpread: string[]; | ||
fields: SelectionSetFieldNode[]; | ||
fragmentsSpread: SelectionSetFragmentSpread[]; | ||
inlineFragments: SelectionSetInlineFragment[]; | ||
hasFragmentsSpread: boolean; | ||
hasInlineFragments: boolean; | ||
hasFields: boolean; | ||
} | ||
@@ -86,2 +100,3 @@ export interface SelectionSetFragmentSpread extends SelectionSetItem { | ||
export interface SelectionSetFieldNode extends SelectionSetItem { | ||
selectionSet: SelectionSetItem[]; | ||
name: string; | ||
@@ -88,0 +103,0 @@ type: string; |
{ | ||
"name": "graphql-codegen-core", | ||
"version": "0.6.0-alpha.f56888d8", | ||
"version": "0.6.0-alpha.f5818070", | ||
"description": "GraphQL types and code generator based on schema", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build-tests": "tsc -p tsconfig.test.json", | ||
"watch": "tsc --watch", | ||
"clean": "rimraf ./dist", | ||
@@ -16,6 +14,2 @@ "lint": "tslint src/**/*.ts", | ||
"debug": "cd dist && node --inspect --debug-brk gql-gen.js", | ||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", | ||
"create-git-tag": "git tag $(cat package.json | json version)", | ||
"dev": "cd dist/cli && nodemon --ext ts,js,d.ts,template,graphql,json,handlebars gql-gen.js --dev --file ../../dev-test/githunt/schema.json --template ts --out ../../dev-test/githunt/typings.d.ts ../../dev-test/githunt/**/*.graphql", | ||
"prepare--": "npm run build && npm run test && npm run create-git-tag && git push && git push --tags", | ||
"test": "jest --no-cache --verbose --runInBand" | ||
@@ -22,0 +16,0 @@ }, |
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
235019
69
732