graphql-network-inspector
graphql-network-inspector copied to clipboard
Persisted Query `operationName` not displayed when using GET request
Describe the bug
Graphql servers, such as Graphql Yoga, supports requests received through POST and GET.
On the client-side, if using Apollo Client, one can use the Persisted Query Link which has a param useGETForHashedQueries
to make persisted queries using GET.
Currently Graphql Network Inspector supports POST and GET requests and Persisted Queries, but for Persisted Queries, the operationName
is correctly displayed only when the request is made using POST method.
To Reproduce
- make a POST request and the
operationName
andextensions
in request body - in Graphql Network Inspector, the Query/Mutation column displays "P myPersistedQuery"
- try the same persisted operation using GET method and passing
operationName
andextensions
in query parameters instead of request's body, e.g. `http://example.com/graphql?operationName=myPersistedQuery&extensions=...... - in Graphql Network Inspector, the Query/Mutation column displays "P Persisted Query" instead of "P myPersistedQuery"
Expected behavior
Same as POST requests, the inspector should extract the operationName
and display it
Screenshots
Desktop (please complete the following information):
- OS: Windows 11
- Chrome Version: 128
I submitted PR https://github.com/warrenday/graphql-network-inspector/pull/149 to fix this issue.