@@ -151,7 +151,7 @@ public GraphQLType lookupOutput(Class clazz) {
151
151
}
152
152
153
153
/**
154
- * Check if the given class if found the registry, if not, first create it ({@link GraphQLInputType}), next add it
154
+ * Check if the given class is found in the registry, if not, first create it ({@link GraphQLInputType}), then add it
155
155
* to the registry
156
156
*
157
157
* @param clazz class on which to preform input introspection
@@ -239,11 +239,17 @@ private GraphQLArgument createRelayInputArgument(Class methodDeclaringClass, Met
239
239
inputType = new GraphQLNonNull (inputType );
240
240
}
241
241
242
+ // Default values need to match type so we replace our default String with null
243
+ Object defaultValue = null ;
244
+ if (!arg .defaultValue ().equalsIgnoreCase (GlitrArgument .NO_DEFAULT_VALUE )) {
245
+ defaultValue = arg .defaultValue ();
246
+ }
247
+
242
248
return newArgument ()
243
249
.name (arg .name ())
244
250
.description (arg .description ())
245
251
.type (inputType )
246
- .defaultValue (arg . defaultValue () )
252
+ .defaultValue (defaultValue )
247
253
.build ();
248
254
}
249
255
@@ -419,7 +425,7 @@ public GraphQLOutputType retrieveGraphQLOutputType(Class declaringClass, Method
419
425
GraphQLOutputType graphQLOutputType ;
420
426
String name = ReflectionUtil .sanitizeMethodName (method .getName ());
421
427
422
- graphQLOutputType = getGraphQLOutputTypeFromAnnotationsOnGetter (declaringClass , method , null );
428
+ graphQLOutputType = getGraphQLOutputTypeFromAnnotationsOnGetter (declaringClass , method );
423
429
graphQLOutputType = getGraphQLOutputTypeFromAnnotationsOnField (declaringClass , method , graphQLOutputType , name );
424
430
425
431
// default OutputType
@@ -468,7 +474,8 @@ private Field getFieldByName(Class declaringClass, String name) {
468
474
return field ;
469
475
}
470
476
471
- private GraphQLOutputType getGraphQLOutputTypeFromAnnotationsOnGetter (Class declaringClass , Method method , GraphQLOutputType graphQLOutputType ) {
477
+ private GraphQLOutputType getGraphQLOutputTypeFromAnnotationsOnGetter (Class declaringClass , Method method ) {
478
+ GraphQLOutputType graphQLOutputType = null ;
472
479
Annotation [] methodAnnotations = method .getDeclaredAnnotations ();
473
480
for (Annotation annotation : methodAnnotations ) {
474
481
// custom OutputType
0 commit comments