Graphiql: Allow searching of the full response

Created on 7 Aug 2016  路  1Comment  路  Source: graphql/graphiql

When using GraphiQL as a development companion, it fails when searching through the graphql response, when the response is large.

Codemirror (which is used to render the data response) only adds a slice of the response to the HTML dom for performance reasons, causing the browser-native search to fail and not find the text you are looking for in the response.

It would be great to intercept the find event and override using a custom search box to walk through the data response.

It's a trivial optimization, but will save a lot of headache when using it as a development companion. I for one had the feeling of going crazy that sometimes data was missing and sometimes it was not, when falling back to curl, it showed that the response always contained the data I was searching for.

Reproduce:

  • Query a large GQL response
  • Use CMD+F to find some string at the end of your response, browser will not find it
  • Use select+all (which codemirror intercepts?) and paste in another window textbox, use cmd+f again and the data is there.
help wanted

Most helpful comment

Added in https://github.com/graphql/graphiql/pull/188, uses the CodeMirror search dialog that they expose via an addon (also some other lint fixes in the example code)

>All comments

Added in https://github.com/graphql/graphiql/pull/188, uses the CodeMirror search dialog that they expose via an addon (also some other lint fixes in the example code)

Was this page helpful?
0 / 5 - 0 ratings