Archives: FAQs

Q: What does “no-code” mean in the context of Hasura + GraphQL?

A: It means that you can spin up a GraphQL API without writing resolvers or server logic manually. Hasura introspects your PostgreSQL database schema, auto-generates queries, mutations, and real-time subscriptions, and provides a GUI to manage tables/relationships.

Q: How does the subscription get triggered in the example?

 A: In the example, a createUser mutation is implemented. Whenever this mutation is called, the code publishes a “newUser” event via the PubSub, so any client subscribed to that event receives the new user data in real time.

Q: What setup is needed to enable GraphQL subscriptions in a NestJS app?

A: You need to install the GraphQL + subscription libraries (@nestjs/graphql, @nestjs/apollo, plus subscriptions-transport-ws or graphql-ws), configure your GraphQL module to enable WebSocket transport, define resolvers for subscription events in addition to queries/mutations, and use a PubSub mechanism to publish events.

Q: Why choose NestJS for real-time GraphQL subscriptions?

A: NestJS provides a modular architecture out of the box, TypeScript support, dependency injection, and built-in support for GraphQL via packages like @nestjs/graphql. It’s well-suited for scalable server applications needing structured code.

Q: What’s the folder or component structure in the example app?

A: There’s a React app with components like a form to create new users, a list component showing users, and a table UI. The app uses a React Router for navigating between list view and form view. Subscription logic is placed in a component listening for new user registration events.

Back To Top