I started using GQL with Express (It is awesome). So I have a couple questions.
How can I make GQL secure so only I can access the API and playground in general. Like Instagram. You can't access their "playground".
When I was working with rest api, I was sending tokens trough Headers to be secure. Where to put them now?
app.use(
"/graphql",
graphqlHTTP({
schema,
graphiql: true,
})
)
For 1) the playground is toggled on or off with that graphiql flag you have there. As for securing it you would want to use a middle where that checks an incoming token of some sort and allows/rejects based on the verification of that token.