Using useSWR as an alternative to Subscriptions?

This page summarizes the projects mentioned and recommended in the original post on /r/nextjs

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • prisma1

    Discontinued 💾 Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated]

  • The tech stack I used for this site was: Prisma w/ GraphQL-Yoga / Apollo & GraphQL / Express / NextJS / MongoDB

  • graphql-yoga

    🧘 Rewrite of a fully-featured GraphQL Server with focus on easy setup, performance & great developer experience. The core of Yoga implements WHATWG Fetch API and can run/deploy on any JS environment.

  • The tech stack I used for this site was: Prisma w/ GraphQL-Yoga / Apollo & GraphQL / Express / NextJS / MongoDB

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • MongoDB

    The MongoDB Database

  • The tech stack I used for this site was: Prisma w/ GraphQL-Yoga / Apollo & GraphQL / Express / NextJS / MongoDB

  • graphql-subscriptions

    :newspaper: A small module that implements GraphQL subscriptions for Node.js

  • The Prisma / GraphQL-Yoga comes with Subscriptions, and this was the first thing I came across when my client asked for realtime updates. The implementation was quite difficult - took me a long time. Eventually, it was working locally, and in staging. However, when it came to the production environment, for some reason it just didn't work! This unfortunately ended up with a user losing an auction, which ultimately went to court etc.

  • SWR

    React Hooks for Data Fetching

  • It must be an environment issue - however I still haven't gotten to the bottom of it. Instead, I've refactored the code and completely removed Subscriptions from the project, replacing them with the SWR package. The code I have implemented essentially looks something like this:

  • Next.js

    The React Framework

  • The tech stack I used for this site was: Prisma w/ GraphQL-Yoga / Apollo & GraphQL / Express / NextJS / MongoDB

  • Express

    Fast, unopinionated, minimalist web framework for node.

  • The tech stack I used for this site was: Prisma w/ GraphQL-Yoga / Apollo & GraphQL / Express / NextJS / MongoDB

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • apollo-tooling

    ✏️ Apollo CLI for client tooling (Mostly replaced by Rover)

  • The tech stack I used for this site was: Prisma w/ GraphQL-Yoga / Apollo & GraphQL / Express / NextJS / MongoDB

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts