prime icon indicating copy to clipboard operation
prime copied to clipboard

Updated apollo-server-express version breaks schema assignment.

Open joaovpmamede opened this issue 6 years ago • 5 comments

I had issues running master with a project that was built with the latest npm released version (v0.3.4-beta.1). After a couple of tests I've decided to downgrade the apollo-server-express from 2.8.1 to 2.6.2 and everything started working again.

From my understanding the issue could be here. I'm not sure but I don't think that this new version allows to set the schema after the instance has been created (new schema initialization/creation).

Two options would be to:

  1. Create a new server instance on schema changes (which in terms of performance could not be great).
  2. Investigate apollo-gateway (not sure if it makes sense here tbh) because it seems that allows to update the schema.

joaovpmamede avatar Sep 08 '19 21:09 joaovpmamede

+1!

irisjae avatar Sep 11 '19 16:09 irisjae

Super super worried XD!!! The schemas were totally empty. I isolated it to the same issue, and tried modifying prime to use apollo's gateway, when I found your fix, and downgrading did it!

irisjae avatar Sep 11 '19 17:09 irisjae

This is the hack I made!

https://github.com/birkir/prime/blob/f28c6a2dc6f2c8692f3b6e2f41d07ab2049787dc/packages/prime-core/src/server.ts#L50-L52

birkir avatar Sep 24 '19 17:09 birkir

still facing this issue from time to time, is there a fix for it? or any updates?

AienTech avatar Apr 12 '21 21:04 AienTech

This eventually got fixed (temporarily) by downgrading all apollo-server-core versions to 2.6. For which I used package resolutions.

This change also seems to come from a refactor that is done inside the apollo server itself, thus not being an implementation issue of primecms. The only issue I'd say is here, is that prime packages aren't updated for a long time, which is eventually leading to incompatibility issues for newcomers.

AienTech avatar Apr 22 '21 08:04 AienTech