apollo-client
Stack
Our great sponsors
apollo-client | Stack | |
---|---|---|
30 | 18 | |
19,183 | 254 | |
0.3% | 0.4% | |
9.8 | 0.0 | |
about 8 hours ago | over 1 year ago | |
TypeScript | ||
MIT License | - |
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.
-
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
-
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...
-
5 tips for debugging Apollo GraphQL MockedProvider
We’re heavy users of Apollo GraphQL in my team at Swarmia, but sometimes mocking the queries is bothersome. And based on a few GitHub comments, it looks like we’re not alone. This blog post is here to help!
-
apollo-client VS remult - a user suggested alternative
2 projects | 27 May 2022
-
lodash debounce in React functional component not working
I have a functional component built around the React Table component that uses the Apollo GraphQL client for server-side pagination and searching. I am trying to implement debouncing for the searching so that only one query is executed against the server once the user stops typing with that value. I have tried the lodash debounce and awesome debounce promise solutions but still a query gets executed against the server for every character typed in the search field.
Stack
-
The complete GraphQL Scalar Guide
This article was published on Tuesday, June 27, 2023 by Eddy Nguyen @ The Guild Blog
-
Optimize your Bundle Size with SWC and GraphQL Codegen
Then you're ready to go! The plugin will automatically optimize your generated code when SWC compiles your files. In conclusion, using the [`client-preset`](https://graphql-code-generator.com/plugins/presets/client-preset) for GraphQL Code Generator is a powerful way to improve the DX of your project. However, without proper optimization, the bundle size can quickly become bloated. By using the [@graphql-codegen/client-preset-swc-plugin](https://www.npmjs.com/package/@graphql-codegen/client-preset-swc-plugin), (or the [Babel plugin](https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#babel-plugin)) you can optimize the generated code and reduce the bundle size, and in the end improve the loading time of your application.
-
Moving from Apollo to Vanilla GraphQL
I started using Apollo and as I got more experienced about GraphQL I found out about The Guild.
-
How we migrated to Apollo Server 4
Second, the developer experience around GraphQL is amazing, and we’ve been fortunate to use some great tools from The Guild and Apollo in building our product. For example, we publish our GraphQL schemas to Apollo Studio, we embed the Apollo Studio Explorer in our docs, and our GraphQL API is actually built on top of Apollo Server.
-
How we shipped CDN access tokens with Cloudflare Workers and R2
Once we decoded the incoming access token we can then read the R2 key value e.g. `/cdn-keys/c7ce447c-f5e6-4f13-87b8-d3051ba3fc45/c7de111c-f5g9-4f13-87b8-d1267ba3ge95` and then check the user-sent `privateKey` against the hash stored there. For subsequent requests, the same cache logic as for the legacy tokens is reused. The UI part was pretty straight-forward and less challenging to build, however it was still part of this project. The new token overview: ![All good](https://the-guild.dev/blog-assets/how-we-shipped-cdn-access-tokens-with-cloudflare-workers-and-r2/phase-4-cdn-access-token-overview.png) Creating a new token: ![All good](https://the-guild.dev/blog-assets/how-we-shipped-cdn-access-tokens-with-cloudflare-workers-and-r2/phase-4-token-create-form.png) We successfully deployed this to production and then informed all our clients that are waiting for this feature. 🎉 In addition, this is of course now also available for the self-hosted Hive users. ## Conclusion This was an exciting and challenging project to solve and Cloudflare provides useful tools for solving these kinds of problems. On the other hand debugging Cloudflare tooling is often frustrating and cumbersome, documentation is also often scarce or non-existing for more advanced use-cases. Nevertheless, we are happy to finish this project successfully and are looking forward to all the future challenges! In case you did not know, Hive is fully open-source and self-hostable! You can find all the code, steps and pull requests on GitHub! * https://github.com/kamilkisiela/graphql-hive/pull/1003 * https://github.com/kamilkisiela/graphql-hive/pull/1043 * https://github.com/kamilkisiela/graphql-hive/pull/1005 * https://github.com/kamilkisiela/graphql-hive/pull/1114 * https://github.com/kamilkisiela/graphql-hive/pull/1120 * https://github.com/kamilkisiela/graphql-hive/pull/1127 * https://github.com/kamilkisiela/graphql-hive/pull/1130 * https://github.com/kamilkisiela/graphql-hive/pull/1142 * https://github.com/kamilkisiela/graphql-hive/pull/1143 * https://github.com/kamilkisiela/graphql-hive/pull/1061
-
Is React still the most heavily dominant framework sought after by employers, or can I start learning other frameworks/libraries when looking for a new job?
The ecosystem offered by https://the-guild.dev/ is a spectacular suite of services offered for free that can really help learning the concepts of development and composable elements.
-
Announcing GraphQL Yoga 2.0!
This article was published on 2022-03-29 by Charly Poly @ The Guild Blog
-
GraphQL error handling to the max with Typescript, codegen and fp-ts
GraphQL Code Generator is a tool developed by The Guild which generates type definitions which corresponds to the GraphQL schema. It has several plugins and we'll use 3 of those:
-
How not to learn GraphQL
Schema Stitching (a component of GraphQL Tools[v6 and under]) got a bad rap when it was famously abandoned by Apollo in favor of their Federation architecture some years back. However, Stitching came under the stewardship of The Guild and friends in 2020, and they've since overhauled it with numerous automation and performance enhancements. Seemingly out of nowhere, Schema Stitching has reemerged as something of a nimble hummingbird racing alongside the stallion that is Apollo Federation.
-
What does it take to support Node.js ESM?
In The Guild we use this method using tooling that creates the temporary package.json automatically. See bob-the-bundler & bob-esbuild
What are some alternatives?
react-relay - Relay is a JavaScript framework for building data-driven React applications.
urql - The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
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.
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.
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]
graphql-request - Minimal GraphQL client
react-apollo
adrenaline
mikro-orm-graphql-example - A MikroORM (v4) example project for GraphQL made with Typescript using TypeGraphQL
react-transmit
apollo-client-maven-plugin - Generate a Java/Kotlin GraphQL client based on introspection data and predefined queries.
graphql-codegen-svelte-apollo - Generator plugin that brings Apollo into your Svelte application