benawad / apollo-mocked-provider

Automatically mock GraphQL data with a mocked ApolloProvider
MIT License
92 stars 25 forks source link

signify which resolver corresponds to a specific query #57

Open roninMo opened 2 years ago

roninMo commented 2 years ago

All of our graphql queries are wrapped in the same object name, so if a component is running multiple queries I don't know of a way to pass each individual resolver to that corresponding query.

Here is an example query, and all of our queries are done this way. It's grabbing account information for our claimant, then returning the data in an object like this:

query GET_CLAIMS_ALERTS($account_number: ID!) {
  account(id: $account_number) {
    items {
      claims {
        items {
          alerts {
            publicID
            alertDescription
            isRead
          }
        }
      }
    }
  }
}

However, in multiple sections I'll be grabbing claim information as well as incidents or alerts, and I don't know a way to send multiple resolvers that signify each query when all go into the account object. I kinda like this repository, but as I was implementing this I noticed this issue along the way, and don't know I should do.