graphql-jpa-query icon indicating copy to clipboard operation
graphql-jpa-query copied to clipboard

How can I override an Entity field dataFetcher?

Open brendanmoorep opened this issue 3 years ago • 0 comments

Is there a way that I can override or add custom logic to the dataFetcher for a field of my entity?

For example, if I have a column "status" that is an integer column, but I'd like the API to respond with the status's corresponding enum value, how could I go about doing that?

@Entity
public class MyEntity {

        // other fields omitted

        // This will return the integer status, how can I return a corresponding ENUM value instead?
        @Column
	@GraphQLDescription("The status")
	private int status;
}

brendanmoorep avatar Apr 11 '22 22:04 brendanmoorep