apollo-codegen-typescript
Advanced tools
Comparing version 0.28.2-register.0 to 1.0.0-alpha.80
@@ -58,1 +58,2 @@ import { GraphQLEnumType, GraphQLInputObjectType } from "graphql"; | ||
export {}; | ||
//# sourceMappingURL=codeGeneration.d.ts.map |
@@ -11,2 +11,3 @@ "use strict"; | ||
const printer_1 = require("./printer"); | ||
const definition_1 = require("graphql/type/definition"); | ||
const graphql_2 = require("graphql"); | ||
@@ -158,3 +159,3 @@ const array_1 = require("apollo-codegen-core/lib/utilities/array"); | ||
} | ||
if (type instanceof graphql_2.GraphQLList) { | ||
if (definition_1.isListType(type)) { | ||
return this.getUnderlyingType(type.ofType); | ||
@@ -168,3 +169,3 @@ } | ||
} | ||
if (type instanceof graphql_2.GraphQLList) { | ||
if (definition_1.isListType(type)) { | ||
type = type.ofType; | ||
@@ -171,0 +172,0 @@ } |
@@ -5,1 +5,2 @@ import { GraphQLType } from "graphql"; | ||
export declare function createTypeFromGraphQLTypeFunction(compilerOptions: CompilerOptions): (graphQLType: GraphQLType, typeName?: string) => t.TSType; | ||
//# sourceMappingURL=helpers.d.ts.map |
@@ -14,3 +14,3 @@ "use strict"; | ||
function nonNullableTypeFromGraphQLType(graphQLType, typeName) { | ||
if (graphQLType instanceof graphql_1.GraphQLList) { | ||
if (graphql_1.isListType(graphQLType)) { | ||
const elementType = typeFromGraphQLType(graphQLType.ofType, typeName); | ||
@@ -33,3 +33,3 @@ return t.TSArrayType(t.isTSUnionType(elementType) | ||
} | ||
else if (graphQLType instanceof graphql_1.GraphQLNonNull) { | ||
else if (graphql_1.isNonNullType(graphQLType)) { | ||
return typeFromGraphQLType(graphQLType.ofType, typeName); | ||
@@ -42,3 +42,3 @@ } | ||
function typeFromGraphQLType(graphQLType, typeName) { | ||
if (graphQLType instanceof graphql_1.GraphQLNonNull) { | ||
if (graphql_1.isNonNullType(graphQLType)) { | ||
return nonNullableTypeFromGraphQLType(graphQLType.ofType, typeName); | ||
@@ -45,0 +45,0 @@ } |
export { generateSource, generateLocalSource, generateGlobalSource } from "./codeGeneration"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -30,1 +30,2 @@ import { GraphQLEnumType, GraphQLInputObjectType, GraphQLType } from "graphql"; | ||
} | ||
//# sourceMappingURL=language.d.ts.map |
@@ -11,1 +11,2 @@ import * as t from "@babel/types"; | ||
export {}; | ||
//# sourceMappingURL=printer.d.ts.map |
{ | ||
"name": "apollo-codegen-typescript", | ||
"description": "TypeScript generator module for Apollo Codegen", | ||
"version": "0.28.2-register.0+36a3f2e", | ||
"version": "1.0.0-alpha.80+1a53960", | ||
"author": "Apollo GraphQL <opensource@apollographql.com>", | ||
@@ -9,14 +9,8 @@ "license": "MIT", | ||
"type": "git", | ||
"url": "git+https://github.com/apollographql/apollo-cli.git" | ||
"url": "git+https://github.com/apollographql/apollo-tooling.git" | ||
}, | ||
"homepage": "https://github.com/apollographql/apollo-cli", | ||
"bugs": "https://github.com/apollographql/apollo-cli/issues", | ||
"homepage": "https://github.com/apollographql/apollo-tooling", | ||
"bugs": "https://github.com/apollographql/apollo-tooling/issues", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"scripts": { | ||
"clean": "rm -rf lib", | ||
"prebuild": "npm run clean", | ||
"build": "tsc", | ||
"prepare": "npm run build" | ||
}, | ||
"engines": { | ||
@@ -27,4 +21,5 @@ "node": ">=8", | ||
"dependencies": { | ||
"@babel/types": "7.0.0-beta.38", | ||
"apollo-codegen-core": "0.29.0-register.0+36a3f2e", | ||
"@babel/types": "7.1.3", | ||
"apollo-codegen-core": "1.0.0-alpha.80+1a53960", | ||
"apollo-env": "0.1.0", | ||
"change-case": "^3.0.1", | ||
@@ -34,2 +29,7 @@ "inflected": "^2.0.3" | ||
"jest": { | ||
"preset": "ts-jest", | ||
"transformIgnorePatterns": [ | ||
"/node_modules/", | ||
"/apollo-env/" | ||
], | ||
"testEnvironment": "node", | ||
@@ -40,3 +40,3 @@ "testMatch": [ | ||
"setupFiles": [ | ||
"<rootDir>/../apollo-codegen-core/src/polyfills.ts" | ||
"<rootDir>/../apollo-env/lib/index.js" | ||
], | ||
@@ -49,5 +49,2 @@ "testPathIgnorePatterns": [ | ||
], | ||
"transform": { | ||
"^.+\\.(ts|js)x?$": "<rootDir>../../node_modules/ts-jest/preprocessor.js" | ||
}, | ||
"moduleFileExtensions": [ | ||
@@ -59,7 +56,8 @@ "ts", | ||
"ts-jest": { | ||
"skipBabel": true | ||
"tsConfig": "<rootDir>/tsconfig.test.json", | ||
"diagnostics": false | ||
} | ||
} | ||
}, | ||
"gitHead": "36a3f2edab15c1ba5ffdf67c7fe2b5797264a730" | ||
"gitHead": "1a53960af3bc8e081ba98f6a5537fc6ce6380082" | ||
} |
@@ -5,6 +5,6 @@ import { parse } from "graphql"; | ||
const schema = loadSchema( | ||
require.resolve("../../../common-test/fixtures/starwars/schema.json") | ||
require.resolve("../../../../__fixtures__/starwars/schema.json") | ||
); | ||
const miscSchema = loadSchema( | ||
require.resolve("../../../common-test/fixtures/misc/schema.json") | ||
require.resolve("../../../../__fixtures__/misc/schema.json") | ||
); | ||
@@ -11,0 +11,0 @@ |
@@ -29,3 +29,3 @@ import * as path from "path"; | ||
import Printer from "./printer"; | ||
import { GraphQLType } from "graphql/type/definition"; | ||
import { GraphQLType, isListType } from "graphql/type/definition"; | ||
import { | ||
@@ -35,3 +35,2 @@ GraphQLNonNull, | ||
getNullableType, | ||
GraphQLList, | ||
GraphQLObjectType | ||
@@ -393,3 +392,3 @@ } from "graphql"; | ||
} | ||
if (type instanceof GraphQLList) { | ||
if (isListType(type)) { | ||
return this.getUnderlyingType(type.ofType); | ||
@@ -458,3 +457,3 @@ } | ||
if (type instanceof GraphQLList) { | ||
if (isListType(type)) { | ||
type = type.ofType; | ||
@@ -461,0 +460,0 @@ } |
@@ -6,7 +6,7 @@ import { | ||
GraphQLID, | ||
GraphQLList, | ||
GraphQLNonNull, | ||
GraphQLScalarType, | ||
GraphQLString, | ||
GraphQLType | ||
GraphQLType, | ||
isListType, | ||
isNonNullType | ||
} from "graphql"; | ||
@@ -33,3 +33,3 @@ | ||
): t.TSType { | ||
if (graphQLType instanceof GraphQLList) { | ||
if (isListType(graphQLType)) { | ||
const elementType = typeFromGraphQLType(graphQLType.ofType, typeName); | ||
@@ -54,3 +54,3 @@ return t.TSArrayType( | ||
} | ||
} else if (graphQLType instanceof GraphQLNonNull) { | ||
} else if (isNonNullType(graphQLType)) { | ||
// This won't happen; but for TypeScript completeness: | ||
@@ -67,3 +67,3 @@ return typeFromGraphQLType(graphQLType.ofType, typeName); | ||
): t.TSType { | ||
if (graphQLType instanceof GraphQLNonNull) { | ||
if (isNonNullType(graphQLType)) { | ||
return nonNullableTypeFromGraphQLType(graphQLType.ofType, typeName); | ||
@@ -70,0 +70,0 @@ } else { |
{ | ||
"extends": "../../tsconfig.base", | ||
"compilerOptions": { | ||
"declaration": true, | ||
"outDir": "lib" | ||
"rootDir": "./src", | ||
"outDir": "./lib" | ||
}, | ||
"include" : [ "src/**/*" ], | ||
"exclude": [ "**/__tests__/*" ] | ||
"include": ["./src/**/*"], | ||
"exclude": ["**/__tests__/*", "**/__mocks__/*"], | ||
"references": [{ "path": "../apollo-codegen-core" }] | ||
} |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
159299
1
5
2340
+ Addedapollo-env@0.1.0
+ Added@babel/types@7.1.3(transitive)
+ Addedapollo-env@0.1.0(transitive)
+ Addedcore-js@3.38.1(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
- Removed@babel/types@7.0.0-beta.38(transitive)
Updated@babel/types@7.1.3