Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

166
Vistas
Make GraphQL api secure

I started using GQL with Express (It is awesome). So I have a couple questions.

  1. 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".

  2. 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,
    })
  )

Thank you.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

  1. I highly suggest that you don't keep your playground open into production. A playground is a web app with its own complexity and thus its own vulnerabilities. See Hacking GraphQL Playground
  2. Authentication is handled in GraphQL exactly the same as in REST. Actually you can even have a REST authentication over your GraphQL App. You can find a lot more information here about how to manage authentication, authorization, and access control properly in GraphQL here: Authentication, Authorization and Access Control for GraphQL
about 4 years ago · Juan Pablo Isaza Denunciar

0

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.

  1. GraphQL works the exact same way as a REST endpoint in that respect. Tokens in the headers is the standard.
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda