graphql-ws VS pothos

Compare graphql-ws vs pothos and see what are their differences.

graphql-ws

Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client. (by enisdenjo)

pothos

Pothos GraphQL is library for creating GraphQL schemas in typescript using a strongly typed code first approach (by hayes)
Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
graphql-ws pothos
21 24
1,657 2,224
- -
7.7 9.3
13 days ago 14 days ago
TypeScript TypeScript
MIT License ISC License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

graphql-ws

Posts with mentions or reviews of graphql-ws. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-01.
  • FLaNK AI - 01 April 2024
    31 projects | dev.to | 1 Apr 2024
  • Websocket with socket.io or GraphQL subscriptions
    4 projects | /r/graphql | 15 Aug 2022
    When using a GraphQL over Websocket protocol you can execute all operation kinds (query, mutation and subscription) over that transport as it is a bidirectional protocol.
  • Graph-ql subscriptions without Apollo
    3 projects | /r/graphql | 24 Jun 2022
    The GraphQL over WebSocket solution definitely requires an additional library on the client for the complexity of the protocol (namely graphql-ws). The readme of that project describes how you can connect to a GraphQL over WebSocket compliant server.
  • Issues with deploy
    6 projects | /r/Netlify | 9 Jun 2022
    10:29:46 AM: Build ready to start 10:29:47 AM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal) 10:29:47 AM: build-image tag: v4.8.0 10:29:47 AM: buildbot version: d7330f24833f29d0263d28116347ab83094a2561 10:29:47 AM: Fetching cached dependencies 10:29:48 AM: Failed to fetch cache, continuing with build 10:29:48 AM: Starting to prepare the repo for build 10:29:48 AM: No cached dependencies found. Cloning fresh repo 10:29:48 AM: git clone https://github.com/josephmasongsong/josephmasongsong-v2 10:29:49 AM: Preparing Git Reference refs/heads/main 10:29:49 AM: Parsing package.json dependencies 10:29:50 AM: Starting build script 10:29:50 AM: Installing dependencies 10:29:50 AM: Python version set to 2.7 10:29:51 AM: Downloading and installing node v16.15.0... 10:29:51 AM: Downloading https://nodejs.org/dist/v16.15.0/node-v16.15.0-linux-x64.tar.xz... 10:29:51 AM: Computing checksum with sha256sum 10:29:52 AM: Checksums matched! 10:29:54 AM: Now using node v16.15.0 (npm v8.5.5) 10:29:54 AM: Started restoring cached build plugins 10:29:54 AM: Finished restoring cached build plugins 10:29:54 AM: Attempting ruby version 2.7.2, read from environment 10:29:56 AM: Using ruby version 2.7.2 10:29:56 AM: Using PHP version 8.0 10:29:56 AM: No npm workspaces detected 10:29:56 AM: Started restoring cached node modules 10:29:56 AM: Finished restoring cached node modules 10:29:57 AM: Installing NPM modules using NPM version 8.5.5 10:29:59 AM: npm WARN EBADENGINE Unsupported engine { 10:29:59 AM: npm WARN EBADENGINE package: '[email protected]', 10:29:59 AM: npm WARN EBADENGINE required: { npm: 'please-use-yarn', yarn: '>= 1.19.1' }, 10:29:59 AM: npm WARN EBADENGINE current: { node: 'v16.15.0', npm: '8.5.5' } 10:29:59 AM: npm WARN EBADENGINE } 10:30:16 AM: npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated 10:30:16 AM: npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated 10:30:17 AM: npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. 10:30:17 AM: npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. 10:30:17 AM: npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. 10:30:20 AM: npm WARN deprecated [email protected]: Package moved to @redux-devtools/extension. 10:30:21 AM: npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. 10:30:25 AM: npm WARN deprecated [email protected]: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md 10:30:30 AM: npm WARN deprecated [email protected]: No longer maintained. Use [lru-cache](http://npm.im/lru-cache) version 7.6 or higher, and provide an asynchronous `fetchMethod` option. 10:30:31 AM: npm WARN deprecated @types/[email protected]: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed. 10:30:36 AM: npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. 10:30:40 AM: npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated 10:30:41 AM: npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated 10:30:44 AM: npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x. 10:31:11 AM: npm ERR! code E401 10:31:11 AM: npm ERR! Incorrect or missing password. 10:31:11 AM: npm ERR! If you were trying to login, change your password, create an 10:31:11 AM: npm ERR! authentication token or enable two-factor authentication then 10:31:11 AM: npm ERR! that means you likely typed your password in incorrectly. 10:31:11 AM: Creating deploy upload records 10:31:11 AM: npm ERR! Please try again, or recover your password at: 10:31:11 AM: npm ERR! https://www.npmjs.com/forgot 10:31:11 AM: npm ERR! 10:31:11 AM: npm ERR! If you were doing some other operation then your saved credentials are 10:31:11 AM: npm ERR! probably out of date. To correct this please try logging in again with: 10:31:11 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1) 10:31:11 AM: npm ERR! npm login 10:31:11 AM: npm ERR! A complete log of this run can be found in: 10:31:11 AM: npm ERR! /opt/buildhome/.npm/_logs/2022-06-09T17_29_57_939Z-debug-0.log 10:31:11 AM: Error during NPM install 10:31:11 AM: Build was terminated: Build script returned non-zero exit code: 1 10:31:11 AM: Failing build: Failed to build site 10:31:11 AM: Finished processing build request in 1m24.040513333s
  • GraphQL Subscriptions: Why we use SSE/Fetch over Websockets
    2 projects | /r/graphql | 27 Apr 2022
    There is already a JavaScript implementation for server + client with support for multiplexing from the same maintainer of graphql-ws: graphql-sse
  • how it subscription work on the apollo server?
    3 projects | /r/graphql | 26 Apr 2022
    Actually WebSocket is not the only protocol for executing GraphQL subscriptions. There is also a graphql-over-sse protocol, which is much more lightweight, and uses Server Sent Events. A popular implementation of it is the graphql-sse library, which is maintained by the same person as graphql-ws. The setup and API of both libraries is pretty similar.
  • Advice on using graphql-ws with Apollo/React
    2 projects | /r/graphql | 25 Oct 2021
    That said, I feel so close to success that I can't quite give up. I am using graphql-ws as I understand this to be the new standard implementation of GraphQL Subscriptions. However, of course, Apollo subscriptions have not been updated to implement this. So, looking at the Recipes over on the graphql-ws documentation I have found the guide for using Apollo client. However as I am new to Apollo, it is using a lot of terms I am unfamiliar with.
  • GraphQL Subscriptions and Mikro-Orm in 2021
    2 projects | dev.to | 14 Oct 2021
    Okay but seriously, if you've fallen down the rabbit hole of Apollo docs pointing you towards one library (subscription-transport-ws) which then points you to another (graphql-ws) , and so on and so forth, then hopefully this helps pull you out.
  • How does a client know if the server managing its subscription goes offline? (Multiple instances)
    2 projects | /r/graphql | 23 Sep 2021
    The most common protocol used today for subscriptions is the Apollo websocket protocol.
  • Graphql Subscriptions w/o apollo
    1 project | /r/graphql | 15 Sep 2021
    GraphQL subscriptions are just web sockets. You can check graphql-ws package if you want something without Apollo dependency. Though I don't understand why you want to not depend on it in the first place.

pothos

Posts with mentions or reviews of pothos. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-01-26.
  • When Do You Use Global Types in Your Project?
    1 project | /r/typescript | 26 Mar 2023
    A project I maintain Pothos uses a global namespace with a bunch of interfaces to allow plugins to extend interfaces defined in core or other plugins. This allows plugins to add new options and methods to objects and classes without the other packages needing to know anything about them.
  • Full-Stack GraphQL-APIs in TypeScript without codegen
    1 project | /r/nextjs | 16 Mar 2023
    I noticed this being shared around on Twitter the other day - pretty handy, as I'm currently trying to architect a similar experience for my job using Pathos and graphql-codegen.
  • Ask HN: What would be your stack if you are building an MVP today?
    47 projects | news.ycombinator.com | 26 Jan 2023
    - tRPC

    But I'd likely throw out Clerk a cheaper option:

    - Supertokens, and also since Supertokens is easy (lots of enthusiastic reports about it), has a managed solution (which is cheaper than the alternatives), is secure and scalable (rotating refresh tokens with JWTs), open source, has magic links, and the architecture of Supertokens would allow me to simply and quickly eject to self-hosting it if/when I'd eventually need to (if the app ever reaches mass-market scale).

    And I might throw out tRPC for the equivalent GraphQL experience (esp. if business strategy dictates I need a 3rd party API):

    - GQty.dev on the client, for inferred queries/mutations. For rapid dev speed. Simple code example: https://gqty.dev/docs/intro Then move to URQL or Relay at scale, or just skip GQty and go with URQL from the start (if scalability trumps dev speed).

    - Pothos http://pothos-graphql.dev on the server, for auto building the schema from your TS code (aka. code-first). Better than Nexus (e.g. Max Stoiber moved from Nexus to Pothos on his Bedrock starter template because Pothos is best in class: https://bedrock.mxstbr.com/tools/pothos/ ).

    And I might throw out NextJS (Webpack) for the equivalent experience in Vite:

    - vite-plugin-ssr, since both architectural control (libraries > frameworks) and Vite rocks. I'd likely then have to make solito-vite https://github.com/nandorojo/solito/discussions/157 to have a unified navigation between React Native and Web, but Solito is allegely tiny, so recreating it should be doable.

    (If doing all of these replacements, maybe starting from scratch would be easier than modifying create-universal-app ... That said, I think if someone made a starter repo with the above choices it would be a real killer!)

    Then I'd also likely use:

    - Vercel (and try their Edge Functions, for a serverless sweet v8 isolates experience without slow cold starts), or maybe Cloudflare Workers (cheaper, slightly more hassle?) for hosting.

    - Planetscale or Supabase for the DB. (Not brave enough to try EdgeDB or SurrealDB just yet, though EdgeDB is close..) Unless I had a specific use case where a more specialized/optimized DB would make sense.

    This stack should stick even post-MVP, as it's not only optimized for a solo developer but for scalability.

  • Real World Rust Backend For Web APIs (GraphQL / REST)
    8 projects | /r/rust | 24 Dec 2022
    Have you used Pothos? It's a way to make GraphQL schemas in TypeScript, in a type-safe way. So the creator of Prisma Client Rust is thinking about making a Pothos-style API based on the t builder pattern:
  • What to use with Apollo Server v4 to achieve type-safety?
    3 projects | /r/graphql | 19 Dec 2022
    I would recommend Pothos (https://pothos-graphql.dev/) as a more modern alternative to typegraphql or nexus.
  • Apollo Layoffs
    6 projects | news.ycombinator.com | 15 Dec 2022
    Depends on language, I've build GraphQL servers in a few, though mostly JavaScript and Python. For Python I used to use Graphene, these days I use Strawberry.

    For JavaScript, I originally used graphql-js and express-graphql, as these were the original libraries and I was a literal day 1 adopter. All the libraries are essentially just wrappers around graphql-js, so it's still viable to use directly. But for schema-building I now use Pothos (https://pothos-graphql.dev/), I'd probably use graphql-helix as the http layer (https://github.com/contra/graphql-helix).

  • Achieving end-to-end type safety in a modern JS GraphQL stack
    9 projects | dev.to | 24 Nov 2022
    Pothos is a breeze of fresh air when it comes to building GraphQL APIs. It is a library that lets you write code-first GraphQL APIs with an emphasis on pluggability and type safety. And it has an awesome Prisma integration! (I am genuinely excited about this one, it makes my life so much easier.)
  • Pothos – Convert TypeScript to GraphQL Schema
    1 project | news.ycombinator.com | 27 Sep 2022
  • How to Build a Type-safe GraphQL API using Pothos and Kysely
    5 projects | dev.to | 29 Aug 2022
    In today's article we are going to create a GraphQL api using the Koa framework together with the GraphQL Yoga library and Pothos. In addition, we will use Kysely, which is a query builder entirely written in TypeScript.
  • Extreme Explorations of TypeScript's Type System
    15 projects | news.ycombinator.com | 27 Jun 2022
    If you're a GraphQL developer, Pothos is the best example - all your user-defined types just fits in it like a glove 99% of the time. It definitely makes the most use of TS generics.

    https://pothos-graphql.dev/

    (I'm a bit sleepy, so this is the main one I can think of at the moment that I really enjoy using.)

What are some alternatives?

When comparing graphql-ws and pothos you can also consider the following projects:

subscriptions-transport-ws - :arrows_clockwise: A WebSocket client + server for GraphQL subscriptions

nexus - Code-First, Type-Safe, GraphQL Schema Construction

apollo-server - 🌍  Spec-compliant and production ready JavaScript GraphQL server that lets you develop in a schema-first way. Built for Express, Connect, Hapi, Koa, and more.

graphql-upload - Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers.

graphql-sse - Zero-dependency, HTTP/1 safe, simple, GraphQL over Server-Sent Events Protocol server and client.

TypeGraphQL - Create GraphQL schema and resolvers with TypeScript, using classes and decorators!

GraphQL Kotlin - Libraries for running GraphQL in Kotlin

graphql-helix - A highly evolved GraphQL HTTP Server 🧬

ws - Simple to use, blazing fast and thoroughly tested WebSocket client and server for Node.js

graphql - GraphQL (TypeScript) module for Nest framework (node.js) 🍷

gqtx - Code-first Typescript GraphQL Server without codegen or metaprogramming