Recommended pattern for combining multiple apollo mutation|query elements? #666
Replies: 3 comments
-
That's also the part I don't get. The documentation always only shows the request on one resolver, but never with multiple. Can't get something like the following working as the name matching will omit the property paginatedProducts: {
query: gql`
query paginatedProducts($categoryIds: [ID!], $categoryId: ID!) {
paginatedProducts(categoryArray: $categoryIds) {
products {
articleNumber
}
pagination {
total
}
}
category(id: $categoryId) {
nameDe
}
}
`, I can separate queries in the smart query definition, but this adds unnecessary back-end server calls. |
Beta Was this translation helpful? Give feedback.
-
@iambumblehead You get the mutation result data with everything returned by the mutation. @renestalder use the |
Beta Was this translation helpful? Give feedback.
-
@Akryum Thanks for the quick response. Kind of assumed that solution. |
Beta Was this translation helpful? Give feedback.
-
For example, if a component needs to use mutations 'createData', 'updateData' and 'deleteData' one might include three nested ApolloMutation elements. Is there a nice way to combine the ApolloMutation elements to one element?
Beta Was this translation helpful? Give feedback.
All reactions