Logo

dev-resources.site

for different kinds of informations.

Apollo integration with MeteorJS v4.2 release and looking to v5

Published at
4/26/2023
Categories
meteor
apollo
graphql
javascript
Author
storytellercz
Categories
4 categories in total
meteor
open
apollo
open
graphql
open
javascript
open
Author
13 person written this
storytellercz
open
Apollo integration with MeteorJS v4.2 release and looking to v5

April 19th saw a a new release of Apollo GraphQL integration for MeteorJS. This MeteorJS package integrates Meteor's account system with Apollo and gives you access to the currently logged in user in the GraphQL context.

In your resolver that would look like this:

upcomingEventsNum: async (
  { _id, type, ownerId }: Blog,
  _: unknown,
  { user }: ResolverContext
) => {
  if (!user) throw new Error('notLoggedIn')
}
Enter fullscreen mode Exit fullscreen mode

The v4.2.0 is a small update that saw the update to the latest Apollo client (v3.7.12) and update of tests to run on GitHub.

This brings us to talk about v5. Since the Apollo client is included in the MeteorJS package it makes the package quiet large and in constant need of updates when a new Apollo package is released. Since in most cases Apollo client NPM package (@apollo/client) gets installed regardless in a MeteorJS app when Apollo is used, the inclusion in the apollo package becomes redundant and is duplication of what is already included by NPM.
This becomes an issue when you try to slim down your bundle size as you suddenly have two instances of @apollo/client in your bundle.

Following the example of jQuery in BlazeJS (where jQuery was removed from Blaze and you have to install in as a peer dependency) the proposal now is to remove Apollo client from the apollo MeteorJS package and allow you to install and manage the Apollo client NPM package independently as a peer dependency.
This slims down your client bundle by removing the duplicate Apollo client and allows you to keep up with the most recent version of Apollo client, at least until changes demand changes in the Meteor's Apollo package.

This proposal is expected to be merged and released as version 5 of the Meteor's Apollo package. Feel free to provide feedback on the PR for v5.

If you want to prepare for this major package upgrade, you just need to add Apollo client package to your application (though chances are you already have it).

meteor npm i --save @apollo/client
Enter fullscreen mode Exit fullscreen mode

Then you just need to wait for the release of v5 and upgrade to it when the time comes and you are done!


If you like my work, please support me on GitHub Sponsors ❤️.

apollo Article's
30 articles in total
Favicon
A Beginner’s Guide to Building GraphQL APIs with Apollo Server
Favicon
Apollo Client in 6 minutes with ReactJS
Favicon
Automatically Generated GraphQL Middleware Service
Favicon
GraphQL Federation with Ballerina and Apollo - Part II
Favicon
GraphQL Federation with Ballerina and Apollo - Part I
Favicon
Cookies Setup in Apollo Studio for NodeJS GraphQL Servers
Favicon
Understanding Apollo Client Cache: How to Manage and Update Nested Data Structures Effectively
Favicon
All you need to know about Apollo-Angular Queries
Favicon
GraphQL Code Generator with TypeScript, React and Apollo Client
Favicon
Apollo GraphQL products for dummies
Favicon
Apollo Federation with Local Subgraphs in a Single Node Process
Favicon
GraphQL in Your Ember App with Glimmer Apollo
Favicon
How to solve the N plus 1 problem in GraphQL with Prisma and Apollo
Favicon
Help! Apollo is changing my graphql query response
Favicon
Handle Multiple Queries & Mutations in React Form using Apollo Client
Favicon
Hasura vs Apollo: Comparing GraphQL Platforms
Favicon
Revolutionize Your Next.js State Management with React Button OnClick and Apollo Set Up
Favicon
Apollo integration with MeteorJS v4.2 release and looking to v5
Favicon
The Ultimate GraphQL and Apollo Server Course with Express and TypeScript
Favicon
Working with the Apollo Client in Faust.js
Favicon
Using Postman and Postman Interceptor to authenticate a session cookie based GraphQL API
Favicon
React.Js, GraphQL and Apollo client
Favicon
How we migrated to Apollo Server 4
Favicon
Take your Next js + GraphQL + TypeScript Setup to the next level
Favicon
Pagination in Headless WordPress with WPGraphQL, Apollo, & Next.js
Favicon
Apollo Server Errors for Clients with TypeScript
Favicon
GraphQL and Apollo Server for Beginners: A Practical Guide
Favicon
Appwrite vs. Hasura vs. Apollo
Favicon
GraphQL no front-end (React e Apollo)
Favicon
How to use apollo client cache for local state management

Featured ones: