wp-graphiql icon indicating copy to clipboard operation
wp-graphiql copied to clipboard

Uri too long

Open TylerBarnes opened this issue 5 years ago • 3 comments

Some servers will error if the URI is too long. Since the query is encoded into the url, this will sometimes be problematic. When the query is removed from the url, the query still loads into the page. I assume from local storage. Is there a reason to encode the query in the url?

TylerBarnes avatar Feb 25 '20 20:02 TylerBarnes

@TylerBarnes I believe the reason to encode it in the url was to make it shareable. I could copy the URL, share it with someone else, and when they paste it the query / mutation would be in GraphiQL for them to execute.

jasonbahl avatar Feb 25 '20 20:02 jasonbahl

If I'm not mistaken, @henrikwirth borrowed code from Gatsby's implementation of GraphiQL. So if this is buggy behavior, there's a chance that Gatsby also has some buggy behavior. Might be worth checking Gatsby to make sure (or borrow more code if it's fixed over there 😄)

jasonbahl avatar Feb 25 '20 20:02 jasonbahl

Ah, makes sense. Maybe we should just set a reasonable upper limit on that then

TylerBarnes avatar Feb 26 '20 20:02 TylerBarnes