Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138249

Reverse engineer graphql query from network tab in safari/chrome

$
0
0

I'm trying to reverse engineer a query that a website fires to a graphQL endpoint, which I can see in the network tab of Safari/Chrome. I know the graphq schema, and can see the full request, which is:

{"query":"query DisruptionOverviewQuery(\n $website: String!\n $count: Int\n $cursor: String\n $query: String\n) {\n website(id: $website) {\n ...DisruptionList\n }\n}\n\nfragment DisruptionList on GQWebsite {\n qry: disruptions(query: $query) {\n items: disruptions(first: $count, after: $cursor) {\n edges {\n node {\n __typename\n ...DisruptionItem_item\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n}\n\nfragment DisruptionItem_item on GQDisruption {\n advice\n cause\n createdAt\n disruptionId\n effect\n status\n id\n measure\n name\n quays {\n quay {\n stopplace {\n name\n id\n uri\n place {\n town\n name\n }\n }\n }\n }\n routeDirections {\n routeDirection {\n dataOwner\n destination\n direction\n internalId\n }\n route {\n publicLineNr\n }\n }\n type\n updatedAt\n validFrom\n validTo\n website\n}\n","variables":{"website":"U_OV","count":6,"cursor":null,"query":""}}

I've tried multiple ways of storing this in a .graphql file, reading as string and then JSON.stringifying it, but none so far have worked. Is there any tool which reverses these types of queries back to a simple string? Thanks in advance!


Viewing all articles
Browse latest Browse all 138249

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>