1212use Overblog \GraphQLBundle \Config \Parser \MetadataParser \TypeGuesser \TypeGuessingException ;
1313use Overblog \GraphQLBundle \Config \Parser \MetadataParser \TypeGuesser \TypeHintTypeGuesser ;
1414use Overblog \GraphQLBundle \Config \Parser \PreParserInterface ;
15+ use Overblog \GraphQLBundle \Enum \TypeEnum ;
1516use Overblog \GraphQLBundle \Relay \Connection \ConnectionInterface ;
1617use Overblog \GraphQLBundle \Relay \Connection \EdgeInterface ;
1718use ReflectionClass ;
@@ -169,7 +170,7 @@ private static function classMetadatasToGQLConfiguration(
169170 if (!$ edgeType ) {
170171 $ edgeType = $ gqlName .'Edge ' ;
171172 $ gqlTypes [$ edgeType ] = [
172- 'type ' => ' object ' ,
173+ 'type ' => TypeEnum:: OBJECT ,
173174 'config ' => [
174175 'builders ' => [
175176 ['builder ' => 'relay-edge ' , 'builderConfig ' => ['nodeType ' => $ classMetadata ->node ]],
@@ -397,7 +398,7 @@ private static function inputMetadataToGQLConfiguration(ReflectionClass $reflect
397398 'fields ' => self ::getGraphQLInputFieldsFromMetadatas ($ reflectionClass , self ::getClassProperties ($ reflectionClass )),
398399 ], self ::getDescriptionConfiguration (static ::getMetadatas ($ reflectionClass )));
399400
400- return ['type ' => $ inputAnnotation ->isRelay ? 'relay-mutation-input ' : ' input-object ' , 'config ' => $ inputConfiguration ];
401+ return ['type ' => $ inputAnnotation ->isRelay ? 'relay-mutation-input ' : TypeEnum:: INPUT_OBJECT , 'config ' => $ inputConfiguration ];
401402 }
402403
403404 /**
@@ -421,7 +422,7 @@ private static function scalarMetadataToGQLConfiguration(ReflectionClass $reflec
421422
422423 $ scalarConfiguration = self ::getDescriptionConfiguration (static ::getMetadatas ($ reflectionClass )) + $ scalarConfiguration ;
423424
424- return ['type ' => ' custom-scalar ' , 'config ' => $ scalarConfiguration ];
425+ return ['type ' => TypeEnum:: CUSTOM_SCALAR , 'config ' => $ scalarConfiguration ];
425426 }
426427
427428 /**
@@ -459,7 +460,7 @@ private static function enumMetadataToGQLConfiguration(ReflectionClass $reflecti
459460 $ enumConfiguration = ['values ' => $ values ];
460461 $ enumConfiguration = self ::getDescriptionConfiguration (static ::getMetadatas ($ reflectionClass )) + $ enumConfiguration ;
461462
462- return ['type ' => ' enum ' , 'config ' => $ enumConfiguration ];
463+ return ['type ' => TypeEnum:: ENUM , 'config ' => $ enumConfiguration ];
463464 }
464465
465466 /**
@@ -504,7 +505,7 @@ private static function unionMetadataToGQLConfiguration(ReflectionClass $reflect
504505 }
505506 }
506507
507- return ['type ' => ' union ' , 'config ' => $ unionConfiguration ];
508+ return ['type ' => TypeEnum:: UNION , 'config ' => $ unionConfiguration ];
508509 }
509510
510511 /**
0 commit comments