-
Notifications
You must be signed in to change notification settings - Fork 329
Description
I am learning how to use graphQL with spring boot,
please check the below code
type Query{
getBankDetails: [Bank]
}
type Bank{
id:ID
bankName: String
bankIFSCCode: String
bankAddress: Address
userAccountDetails: [Accounts]
numberOfAccounts : Int
}
// Exempted some code which is working fine //
@BatchMapping(typeName = "Bank")
public Flux<List> userAccountDetails(List bank, DataFetchingFieldSelectionSet selectionSet){
System.out.println(" The Accounts fields data is "+
selectionSet.getFields());
return accontsService.getBankAccountsDetailsByBankCode(bank.stream().map(Bank::getBankCode).collect(
Collectors.toList()
));
}
When trying for this with query I am getting error like below
2025-01-23T19:48:42.557+05:30 ERROR 8460 --- [graphql-playGround] [ctor-http-nio-2] s.g.e.ExceptionResolversExceptionHandler : Unresolved IllegalStateException for executionId 3662d1cc-1
java.lang.IllegalStateException: Could not resolve parameter [1] in public reactor.core.publisher.Flux<java.util.List<com.ssk.graphql_playGround.model.Accounts>> com.ssk.graphql_playGround.controller.GraphqlAccountController.userAccountDetails(java.util.List<com.ssk.graphql_playGround.model.Bank>,graphql.schema.DataFetchingFieldSelectionSet): Unexpected argument type.
The same logic works fine when I remove the DataFetchingFieldSelectionSet and its implementation from the method userAccountDetails
Thank you in Advance