Skip to content

Need Help with DataFetchingFieldSelectionSet for @BathchMapping #1114

@saliverusaikumar6

Description

@saliverusaikumar6

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: stackoverflowA question that's better suited to stackoverflowstatus: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions