Closed PhilippeChab closed 1 year ago
Oh, good catch. Indeed, we can detect persisted queries for POST requests, although this is not the primary use case.
However, I am not really a fan of this "unknown" thing. You're right in the sense that we don't know what kind of operation we're doing, but persisted query is mainly for queries. Queries do not change often, but mutations do. That's why mutations are not good candidates for persisted queries. I would vote to assume that a persisted query (GET or POST) should be treated as a query.
... but persisted query is mainly for queries. Queries do not change often, but mutations do. That's why mutations are not good candidates for persisted queries.
This is not true. :) Persisted queries are equally as useful for queries as for mutations. The goal of a persisted query is purely to reduce the request's size, whether it is a POST or a GET doesn't matter.
Executing a GraphQL request as a GET is an other optimization to exploit HTTP caching, something that cannot be done when performing a POST.
That being said, I agree that Unknowns
is not ideal UX wise. Persisted POSTs
, maybe? I'm open to any suggestion. :)
Links:
Well, I may not have made myself clear earlier. I know how Persisted Query works, but what I was trying to say is that using it for mutation is not really effective. You will almost always hit the "miss" cache because a mutation often changes. In this case, I meant that using Persisted Query for mutation should not be used by many people. And so I would opt to assume that a PQ is (almost) always for queries.
Otherwise, we could go for "Persisted" like you suggest. They are not readable in general so it could be better in term of UX (knowing which are readable and which are not).
Let's go with persisted
!
Looks good to me.
Looks great! Thanks @PhilippeChab
Description
Thanks to this commit, the extension now supports GET persisted queries. While GET requests allow the browser to use HTTP caching, persisted queries can also be made with POST requests.
This PR adds the support to persisted queries made with POST requests.
Screenshot
persisted
type is because a persisted query made as a POST can be either a query or a mutation.Checklist
Closes https://github.com/warrenday/graphql-network-inspector/issues/71