title: Hasura - calling from Express
body: <p>Getting my feet wet with Hasura, working on creating an JWT auth server. Please let me know if I'm on the wrong track anywhere here, I'm still navigating this architecture.</p>
  
  <p>So what I have is:</p>
  
  <ul>
  <li>Hasura GraphQL Engine</li>
  <li>Postgres database</li>
  <li>Node Express server</li>
  </ul>
  
  <p>From reading the Hasura docs on authentication, it describes needing another service that provides the JWT token that the client uses to access Hasura. So I'm rolling with that paradigm, implementing an Auth service using NodeJS.</p>
  
  <p>Users are managed in the same Postgres database hooked into Hasura. What makes sense to me is that my Auth service connects to Hasura for some User related operations (fetch to check login credentials, and User creation since the hashing algorithm should be in one place). So the question here is, how should I be connecting to Hasura from Express? I only found <a href="https://github.com/hasura/express-example/blob/master/app/server.js" rel="nofollow noreferrer">one example</a> that's a little rough... also I would want to avoid connecting directly to Postgres, as it would somewhat defeat the purpose of Hasura (I intend to creating an Auth role that only the Auth service has credentials for).</p>
  
  <p>Would it make sense to use <code>apollo-server</code> in this scenario? I don't necessarily want to create a full GraphQL server (having Hasura already), I would only want those specific operations to be accessible. I'm also green with GraphQL which accounts for some of my floundering here. Any advice is appreciated!</p>