graphql-devtools icon indicating copy to clipboard operation
graphql-devtools copied to clipboard

Support more GraphQL formats

Open stefansundin opened this issue 7 years ago • 1 comments

Hi!

This extension is great, thank you. It works great on GitHub, but there are a couple of other websites that use GraphQL that are not detected.

Twitch - https://www.twitch.tv/

  • Endpoint: https://gql.twitch.tv/gql
  • I don't think it's detected because the extension assumes the query has to be at the top level. Here an array of queries are sent.

Instagram - https://www.instagram.com/

  • Endpoint: https://www.instagram.com/graphql/query/
  • Try the search feature. A query_hash is sent, so I guess we don't have access to the actual query, which is a shame. But variables are present. Might be harder to support, but I figured I'd mention it at least.

That's the two I tested immediately after installing the extension. Thanks!

stefansundin avatar Apr 09 '18 03:04 stefansundin

This extensions looks really really good, but gotta add a +1 to this as it fails to detect a lot of GraphQL end points, which makes it not very useful :(

@s12v Are you considering adding support for more endpoints?

EDIT: I looked into it, the issue is lots of GraphQL API's use mutliple operations in a query string. Like this:

'[{"operationName": "one", "variables":{},"query":"query testOne {\n one \n} }\n"}, {"operationName": "two", "variables":{},"query":"query testTwo {\n two \n} }\n"}]'

I'm working on a PR at the moment, but I'm new to React/Extensions...

#7 PR made, hopefully this fixes it.

bag-man avatar Feb 28 '19 15:02 bag-man