Comments (2)
As long as that token is read from GET params, then yes. You simply add it as a GET param in the request to graphiql as well.
The idea with the GraphiQL integration is that any GET request to a GraphQL endpoint should also work as a view into GraphiQL by sending the Accept: application/html
header that all browsers send.
Try: http://yourserver.com/graphql?token=yourtokenhere&q={__typename}
If this doesn't work for you because your token must be sent via POST params, then you'll need to provide a custom version of GraphiQL. That's not too hard, recycle as much of https://github.com/graphql/express-graphql/blob/master/src/renderGraphiQL.js as you want, adding the POST details to the fetcher
and expose it via a different path in your express
app.
from express-graphql.
Makes sense. Thanks!
Best,
Jon
On Thu, Mar 10, 2016 at 11:40 PM Lee Byron
<
mailto:Lee Byron [email protected]
wrote:
As long as that token is read from GET params, then yes. You simply add it as a GET param in the request to graphiql as well.
The idea with the GraphiQL integration is that any GET request to a GraphQL endpoint should also work as a view into GraphiQL by sending the
Accept: application/html
header that all browsers send.
Try:
http://yourserver.com/graphql?token=yourtokenhere&q={__typename}
If this doesn't work for you because your token must be sent via POST params, then you'll need to provide a custom version of GraphiQL. That's not too hard, recycle as much of
https://github.com/graphql/express-graphql/blob/master/src/renderGraphiQL.js
as you want, adding the POST details to the
fetcher
and expose it via a different path in your
express
app.
—
Reply to this email directly or
#49 (comment)
.
from express-graphql.
Related Issues (20)
- depth-limit HOT 1
- Is there a way to customize a logger HOT 1
- Unhandled errors does not provide mutation or query name HOT 1
- Graphiql playground not displayed in the browser HOT 1
- UnhandledPromiseRejectionWarning: Unhandled promise rejection HOT 1
- Why isn't the callback of app.listen() called when using express-graphql middleware? HOT 4
- Build when installed from GitHub HOT 1
- throw new MiddlewareError(`Type ${type} exists in middleware but is missing in Schema.`);
- TypeScript - merge declarations for request and response types
- Cannot install with graphql 16.0.1 HOT 10
- Update GraphQL Schema at runtime HOT 4
- Graphql 16.2.0 support HOT 9
- Processing timeout HOT 1
- About compatible version for an old graphql and node
- Swallow GraphQL errors by Express HOT 6
- Peer dependency error on new installation of graphql HOT 8
- Unmet Peer version, need to update supported dependencies HOT 9
- revert revert "Allow custom handling of runtime query errors" HOT 1
- Unable to find Prisma Client in GraphQL context. Please provide it under the `context[\"prisma\"]` key. HOT 1
- Support for running method on every call
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from express-graphql.