2 ms·
And when intermediate proxies happily retry your small “delete the most recent record” request because it was a GET which is, in the rest of reality, guaranteed
by davidbanham 6y ago
And when intermediate proxies happily retry your small “delete the most recent record” request because it was a GET which is, in the rest of reality, guaranteed not to alter state on the receiving server except in the corner of the internet you’ve defined as your own it’s destructive?
- RedShift1 6y agoYou can use GET for read queries and POST for write queries. Edit: actually you made me think a little bit more about this, if you can make your mutations idempotent, spurious retried POST requests shouldn't be a problem at all. However "delete the last record" is not an idempotent operation by definition but also one you wouldn't use in the real world - usually you delete by ID. Edit 2: it's easy to make the server reject mutations sent via GET.
- masklinn 6y agoRPC over HTTP pretty much always goes through POST, sometimes with the option of using GET for querying as an optimisation. For graphql specifically, if you allow GET-ing the GraphQL endpoint (which usually isn't the case by default), it's trivial to ensure only queries go through that method.