@@ -35,12 +35,24 @@ const builtInScalarMap = {
35
35
[ GraphQLID . name ] : 'GraphQLID'
36
36
} ;
37
37
38
+ const INFLECTOR_BLACK_LIST = [ 'delta' ] ;
39
+
40
+ Inflector . inflections ( 'en' , function ( inflect : any ) {
41
+ INFLECTOR_BLACK_LIST . forEach ( w => {
42
+ inflect . uncountable ( w , w ) ;
43
+ } ) ;
44
+ } ) ;
45
+
38
46
export class Helpers {
39
47
constructor ( public options : CompilerOptions ) { }
40
48
41
49
// Types
42
50
43
- typeNameFromGraphQLType ( type : GraphQLType , unmodifiedTypeName ?: string , isOptional ?: boolean ) : string {
51
+ typeNameFromGraphQLType (
52
+ type : GraphQLType ,
53
+ unmodifiedTypeName ?: string ,
54
+ isOptional ?: boolean
55
+ ) : string {
44
56
if ( isNonNullType ( type ) ) {
45
57
return this . typeNameFromGraphQLType ( type . ofType , unmodifiedTypeName , false ) ;
46
58
} else if ( isOptional === undefined ) {
@@ -64,7 +76,9 @@ export class Helpers {
64
76
builtInScalarMap [ type . name ] ||
65
77
( this . options . passthroughCustomScalars
66
78
? this . options . customScalarsPrefix + type . name
67
- : getTypeForAWSScalar ( type ) ? getTypeForAWSScalar ( type ) : GraphQLString . name )
79
+ : getTypeForAWSScalar ( type )
80
+ ? getTypeForAWSScalar ( type )
81
+ : GraphQLString . name )
68
82
) ;
69
83
}
70
84
@@ -167,13 +181,16 @@ export class Helpers {
167
181
}
168
182
169
183
propertyFromInputField ( field : GraphQLInputField ) {
170
- return Object . assign ( { } , {
171
- propertyName : camelCase ( field . name ) ,
172
- typeName : this . typeNameFromGraphQLType ( field . type ) ,
173
- isOptional : ! ( field . type instanceof GraphQLNonNull ) ,
174
- description : field . description || null ,
175
- name : field . name ,
176
- } ) ;
184
+ return Object . assign (
185
+ { } ,
186
+ {
187
+ propertyName : camelCase ( field . name ) ,
188
+ typeName : this . typeNameFromGraphQLType ( field . type ) ,
189
+ isOptional : ! ( field . type instanceof GraphQLNonNull ) ,
190
+ description : field . description || null ,
191
+ name : field . name
192
+ }
193
+ ) ;
177
194
}
178
195
179
196
propertiesForSelectionSet (
0 commit comments