We want to decorate queries with whether or not they can be cached, so we can opt-in queries for caching (despite a user being logged-in). This is very experimental/first-draft-y!
A GraphQL directive is a great generic way to...decorate(!), and would be extensible to other clients and doesn't require needing to override any Relay/query types (to add 'metadata') or anything esoteric like that.
Really, the only odd thing is that this decorator needs to be supported in the schema (so here in Metaphysics), but it's not actually for use in Metaphysics - it's more for use by Relay middleware to control caching headers when making the GraphQL request.
I guess it's not that odd, plus this doesn't actually do anything so we can easily remove it.
We want to decorate queries with whether or not they can be cached, so we can opt-in queries for caching (despite a user being logged-in). This is very experimental/first-draft-y!
A GraphQL directive is a great generic way to...decorate(!), and would be extensible to other clients and doesn't require needing to override any Relay/query types (to add 'metadata') or anything esoteric like that.
Really, the only odd thing is that this decorator needs to be supported in the schema (so here in Metaphysics), but it's not actually for use in Metaphysics - it's more for use by Relay middleware to control caching headers when making the GraphQL request.
I guess it's not that odd, plus this doesn't actually do anything so we can easily remove it.