Is there a way to use generic type <T> in graph QL?

Viewed 401

I am trying to return the results of API calls in the existing work by applying them to T content in Response. We are trying to transform this into graphQL. This is my response.

@Builder
@Getter
@AllArgsConstructor
public class Response<T> {
    Result response;
    T contents;
}

However, graphqls fails to parameterize generic T and fails mapping. Below is the corresponding error code. Could not resolve type variable 'com.example.projectj.vo.Response:T' because declaring type is not parameterized: com.example.projectj.vo.Response<T>

public ResponseEntity<Response> getMemberList() {
        Page<MemberVo> result = memberService.getMemberList();
        return new ResponseEntity<>(Response.builder().response(Result.builder().build()).contents(result).build(), HttpStatus.OK);
    }

This is my request.

0 Answers
Related