Making the great GraphiQL tool available anywhere as a Chrome extension.
Based on the GraphiQL example code.
Chrome extension to use GraphiQL anywhere
License: MIT License
Making the great GraphiQL tool available anywhere as a Chrome extension.
Based on the GraphiQL example code.
Hey, thanks for this plugin. Can you update graphiql version? Newer version has "prettify" feature.
Great Tool! It would be nice if user can also define custom headers to access the endpoint like authorization header.
GraphiQL has had new versions which add things like the much-requested support for HTTP request headers. I assume it should be pretty straightforward to upgrade chromiql to use the latest graphiql version and acquire all the fixes and new features.
@ermanc Any plans for a version update and Chrome app store release? And/or how can the OSS community assist in accomplishing this?
I have just installed the Chrome plugin but it seems like it's not working. When the page loads it sends a Graphql request to the endpoint that I have specified, but not with the query that I typed (it uses some other query, don't know where it gets it from). And I also can't fire the query again, probably because of the JS error.
Screenshots:
http://take.ms/smKc9
http://take.ms/3MMbo
Just flagging that I can't get the extension to work with .local domains:
The recurrent error seems to be:
chromeiql.js:61661
Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:".
How can the following syntax error be resolved:
SyntaxError: Unexpected token < in JSON at position 0
at chrome-extension://fkkiamalmpiidkljmicmjfbieiclmeij/dist/chromeiql.js:60748:23
This extension is setting variables
to a string before the entire request payload is stringified, instead of sending an object which is more standard.
When the extension is re-opened two request are sent to the endpoint on-load.
This is likely due to initialization of GraphiQL fetcher property.
<GraphiQL...
fetcher = {graphQLFetcher(endpoint)}
Attempt to fetch only when currentEndpoint is set would avoid this.
<GraphiQL...
fetcher = {...this.state.currentEndpoint ? graphQLFetcher(endpoint) : function(){}}
Great work on the extension, I just thought it would be cool if the extension could open automatically when you try to go to a GraphQL endpoint instead of showing the usual GET query missing.
message.
So something like:
Hello,
I've been playing with ChromeiQL and it's awesome. We used to include graphiql as part of our app and now we can avoid doing that.
Is it possible to publish this for Firefox as well?
The new versions of Firefox use the same extension format as Chrome (AFAIK).
Are there any plans to publish this as Firefox?
Thanks,
Steps
Result
The mutation is executed after both steps 4 and 5. This is potentially destructive. Lots of time might have passed between steps 3 and 4 and I might not even remember that I left a mutation query lying around. Even if I do remember I don't know of a way to open ChromeiQL without executing the existing query. If the URL I typed in step 5 was a production URL this could be catastrophic.
Notes
It's a bad practice to leave mutations lying around in the query window, but when I'm developing a mutation API it is a very easy mistake to make.
When trying to run ChromiQL against local GQL server, getting the following error in UI:
{
"errors": [
{
"message": "Cannot query field \"locations\" on type \"__Directive\"."
}
],
"data": null
}
Although it was working fine with 0.1 version.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.