graphql-network-inspector icon indicating copy to clipboard operation
graphql-network-inspector copied to clipboard

Persisted Query `operationName` not displayed when using GET request

Open gthau opened this issue 5 months ago • 0 comments

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

  1. make a POST request and the operationName and extensions in request body
  2. in Graphql Network Inspector, the Query/Mutation column displays "P myPersistedQuery"
  3. try the same persisted operation using GET method and passing operationName and extensions in query parameters instead of request's body, e.g. `http://example.com/graphql?operationName=myPersistedQuery&extensions=......
  4. 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 persistedqueries_operationname_missing

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.

gthau avatar Sep 08 '24 15:09 gthau