apollo-client
MongoDB
Our great sponsors
apollo-client | MongoDB | |
---|---|---|
30 | 11 | |
19,199 | 9,951 | |
0.3% | 0.3% | |
9.8 | 9.1 | |
about 20 hours ago | 2 days ago | |
TypeScript | TypeScript | |
MIT License | Apache License 2.0 |
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.
apollo-client
-
Things I wish I knew before moving 50K lines of code to React Server Components
Actually, it's worse than that. Next has started throwing errors if it statically detects you even _importing_ hooks inside of a React Server Component environment:
- https://github.com/apollographql/apollo-client/issues/10974
- https://github.com/apollographql/apollo-client/issues/11167
To the point that Lenz Weber( a maintainer of Apollo Client, and my co-maintainer on Redux Toolkit), is considering resorting to a package that wraps and re-exports all of React's public API just to avoid that static analysis:
-
Top React Data Fetching Libraries
Apollo Client (18k ⭐) -> A comprehensive state management library for JavaScript that enables you to manage both local and remote data with GraphQL. Use it to fetch, cache, and modify application data, all while automatically updating your UI.
-
Using apollo client cache for local state
This currently doesn't work as expected so I have logged this issue in apollo client repo.
- React Server Components
-
Sveltekit SPA Mode: Prevent serverside code
I understand this has something to do with the fact, that SvelteKit expects the client and server code to be completely identical - this has already prompted changes to rxjs and apollo is still pending to be fixed. I understand the reason behind being able to run rxjs and apollo on the server but
-
Handling Apollo Errors in React
There is a long-standing issue with error caching (its absence, that is), which leads to errors being rendered as a loading state on the server side. Therefore, if you're doing SSR, you might want to design your schema in such a way that there are no intentional errors in queries whatsoever. To do so, we can use null values instead of NOT_FOUND errors (see how we essentially treated errors as data here?). Note how nothing stops us from setting the response code to 404 in case of a null value, should we want so.
-
Next.js 13: Layouts, React Server Components (async/await), Streaming
Lol apollo client too.. saw this issue opened like, immediately after the release https://github.com/apollographql/apollo-client/issues/10231
-
Paginating an already fetched set of data - Apollo Client/Server
There were some caching issues, outlined here https://github.com/apollographql/apollo-client/issues/6916 to be aware of
-
The Case for C# and .NET
If you look at how major backend projects structure their code, it's almost always object-oriented TypeScript.
I submit for the record:
- Apollo Client: https://github.com/apollographql/apollo-client/blob/main/src...
- Storybook: https://github.com/storybookjs/storybook/blob/next/lib/chann...
- Nest: https://github.com/nestjs/nest/blob/master/packages/core/nes...
- MongoDB Driver: https://github.com/mongodb/node-mongodb-native/blob/main/src...
- Prisma: https://github.com/prisma/prisma/blob/main/packages/engine-c...
-
A high-level overview of Concurrent React
[※Alert: The following is a code example using the Apollo Client notation, but the Apollo Client does not support Suspense at this time. Github issue about Suspense support: https://github.com/apollographql/apollo-client/issues/9627]
MongoDB
-
How does one set up MongoDB using "vanilla" JS?
The MongoDB JavaScript driver uses and requires node.js, which is what 99.9% of server-side JavaScript implementations use.
-
The Case for C# and .NET
Mongo Drivers
If you look at how major backend projects structure their code, it's almost always object-oriented TypeScript.
I submit for the record:
- Apollo Client: https://github.com/apollographql/apollo-client/blob/main/src...
- Storybook: https://github.com/storybookjs/storybook/blob/next/lib/chann...
- Nest: https://github.com/nestjs/nest/blob/master/packages/core/nes...
- MongoDB Driver: https://github.com/mongodb/node-mongodb-native/blob/main/src...
- Prisma: https://github.com/prisma/prisma/blob/main/packages/engine-c...
-
Save Transcripts to MongoDB with a Node.js Webhook
The MongoDB Node.js Driver, to save data to MongoDB;
-
Error filtering not working
The error probably is a MongoServerError, not MongoError, see https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/errors.md
-
Intro to MongoDB and Mongoose - How Every Web Developer Can Become FullStack With Node.js
The most basic way to interact with MongoDB is using the Official MongoDB Node.js Driver, in this guide we will use Mongoose an object modeling tool.
- Mongo Atlas Upgrading M0 M2 M5 shared instances to v5.0 (Mid Feb)
-
Define MongoDB _id-Type as String
Now when you use the collection, you'll get better type support for for all the collection methods. Note that I had to make the _id required on the schema. If you make it optional, you still get a type error. The node driver team is working on this and other issues related to the type of _id in this PR: https://github.com/mongodb/node-mongodb-native/pull/3077
-
Connect to MongoDB Atlas from SvelteKit
To communicate with MongoDB database we will need Node driver mongodb. So install it.
-
Totally stuck with listIndexes calls. Our volunteer social project building community migrated from Mlab to Mongo DB's Atlas in Nov and all our sites died. I've tried everything i can think to get the platform back up. Can anyone help or offer advice?
Could this _ensureIndex be the problem? I think that may be calling into listIndexes here: https://github.com/mongodb/node-mongodb-native/blob/2b18411d2f57e06d11262d5a308c56a9f561789e/lib/operations/db_ops.js#L305. IIRC, ensureIndex is deprecated, and you should use createIndex instead. I'm not familiar with meteor, so I'm not exactly sure what that code looks like, but the README shows how to access the underlying MongoDB driver directly: https://github.com/meteor/meteor/tree/devel/packages/mongo#direct-access-to-npm-mongodb-api. Hope that helps!
What are some alternatives?
react-relay - Relay is a JavaScript framework for building data-driven React applications.
Prisma - Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
urql - The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
Redis - 🚀 A robust, performance-focused, and full-featured Redis client for Node.js.
TanStack Query - 🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
PostgreSQL - PostgreSQL client for node.js.
sveltekit-graphql-github - Use Apollo Client with SvelteKit to Query a GraphQL API: we use the GitHub API to query our repos and learn a bit of SvelteKit along the way.
MySQL - A pure node.js JavaScript Client implementing the MySQL protocol.
react-query - 🤖 Powerful asynchronous state management, server-state utilities and data fetching for TS/JS, React, Solid, Svelte and Vue. [Moved to: https://github.com/TanStack/query]
Aerospike - Node.js client for the Aerospike database
graphql-request - Minimal GraphQL client
LevelUP - A wrapper for abstract-leveldown compliant stores, for Node.js and browsers.