Meteor methods vs apollo mutations


#1

I consider to use apollo in an upcoming project. I understand the advantages of graphql queries compared to the pubsub system. However I don’t quite understand if there is any difference between mutations and methods.
Queries are flexible (i.e. the schema can be queried in many different ways without changing anything), but mutations are a 1:1 mapping between intent and implementation. I.e. If I want it to do something else I need to change the code. So it seems to me that methods and mutations are pretty much the same. It is just a way to call a server function from the client.
My plan is to use graphql to get data and to stick with meteor methods. This way I am fully database agnostic, and still get the simplicity of validated methods over graphql mutations.

Did I miss any reason for why I should use mutations instead (I haven’t had a deep look into them)


#2

One difference I see is that grapql mutations are (same with queries) automatically documented and documentable by GraphiQL. Also if you want to open up your GraphQL endpoint to devs, they can see all the operations in one place.


#3

Taken from https://www.apollographql.com/docs/react/basics/mutations.html#mutation-results

In GraphQL, mutations can return any type, and that type can be queried just like a regular GraphQL query.

I think this is the real power of mutations. You can treat your mutation result just like any other query and get the exact shape of data for the desired result, whereas a method always returns the same data shape.