swarthout / feathers-apollo

Feathers and Apollo Server Sample Project
MIT License
176 stars 20 forks source link

Passing in token via GraphiQL #14

Closed idibidiart closed 7 years ago

idibidiart commented 7 years ago

So I got as far as getting an auth token after login. But when I create a post via GraphiQL, how do I pass in that token?

medv commented 7 years ago

There is a graphiql fork somewhere that gives you richer experience by offering you presets (for any queries/mutations/variables you want to keep in that preset) as well as attaching authentication. I forget where it is, please have a look for any electron-based graphiql or related google chrome apps. The particular one I'm mentioning exists somewhere on github here and is not that different to include in your project from stock graphiql.

I will reply when I come across it as I will be going down the same path soon. In the meantime, if you come across an answer, I'd appreciate hearing from you. : )

swarthout commented 7 years ago

I use this one https://github.com/skevy/graphiql-app and you can add the authorization header with the JWT you get from the login mutation

idibidiart commented 7 years ago

Ok awesome! Can you please add it to the Readme?

idibidiart commented 7 years ago

I've decided to take your work to its eventual aim and will produce a version that references your work, so all good now. Thanks for leading the way on this @swarthout !