Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

A way to return data even if one of the query fails #445

Open
@mahendragohel

Description

@mahendragohel

I wanted to return a data even if one query fails.

For example,
I have below two queries which are part of my queryResolver class.

    public List<Ticket> searchTicket(String searchInput){
        String acceptLanguage = graphqlUtils.getRequestHeader(ACCEPT_LANGUAGE);
            return searchTicketEntity.searchTicket(acceptLanguage, searchInput, null, null, null);

    }
    public Ticket retrieveTroubleTicket(String ticketId){
        String acceptLanguage = graphqlUtils.getRequestHeader(ACCEPT_LANGUAGE);
            return searchTicketEntity.retrieveTicket(acceptLanguage, ticketId);
    } 

When i do query like below

query { 
    searchTicket(searchInput: \"id=Ticket_15918088411\") {
      id   
      description 
      type 
      creationDate
    }  
    retrieveTroubleTicket(troubleTicketId: \"Ticket_77276977843\") {
      id 
      description 
    } 
}

and one of the query fails it does not return the data of another query with error.
I want to return the data and error if one the query fails.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions