common/schema-builder/src/main/java/io/smallrye/graphql/schema/creator/FieldCreator.java
/**
     * Creates a field from a method only.
     * This is used in the case of an interface
     *
     * @param methodInfo the java method
     * @return a Field model object
     */
Creates a field from a method only.
This is used in the case of an interface

@param methodInfo the java method
@return a Field model object
Creates a field from a method only . This is used in the case of an interface @param methodInfo the java method @return a Field model object
public Optional<Field> createFieldForInterface(MethodInfo methodInfo, Reference parentObjectReference) {
        Annotations annotationsForMethod = Annotations.getAnnotationsForInterfaceField(methodInfo);
        if (!isGraphQlField(Direction.OUT, null, methodInfo)) {
            return Optional.empty();
        }
        Type returnType = methodInfo.returnType();
        String name = getFieldName(Direction.OUT, annotationsForMethod, methodInfo.name());
        validateFieldType(Direction.OUT, methodInfo);
        Reference reference = referenceCreator.createReferenceForInterfaceField(returnType, annotationsForMethod,
                parentObjectReference);
        Field field = new Field(methodInfo.name(), MethodHelper.getPropertyName(Direction.OUT, methodInfo.name()), name,
                reference);
        configure(field, returnType, annotationsForMethod);
        return Optional.of(field);
    }
public Optional < Field > createFieldForInterface ( MethodInfo methodInfo , Reference parentObjectReference ) { Annotations annotationsForMethod = Annotations . getAnnotationsForInterfaceField ( methodInfo ) ; if ( ! isGraphQlField ( Direction . OUT , null , methodInfo ) ) { return Optional . empty ( ) ; } Type returnType = methodInfo . returnType ( ) ; String name = getFieldName ( Direction . OUT , annotationsForMethod , methodInfo . name ( ) ) ; validateFieldType ( Direction . OUT , methodInfo ) ; Reference reference = referenceCreator . createReferenceForInterfaceField ( returnType , annotationsForMethod , parentObjectReference ) ; Field field = new Field ( methodInfo . name ( ) , MethodHelper . getPropertyName ( Direction . OUT , methodInfo . name ( ) ) , name , reference ) ; configure ( field , returnType , annotationsForMethod ) ; return Optional . of ( field ) ; }
Creates a field from a method only.
Creates a field from a method only .
// Name // Field Type