Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Apollo v4 support & Drop Apollo v2/v3 and Node 16 support #2444

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ardatan
Copy link
Collaborator

@ardatan ardatan commented Oct 10, 2023

Closes #2270

This PR also updates example with latest versions of GraphQL Yoga and Apollo Server.
It also replaces deprecated Express GraphQL with the new GraphQL HTTP reference implementation.

First of all, I removed apollo executor and apollo schema creation. executor is not available anymore in Apollo Server's constructor, so instead we create a gateway instance to pass the schema and our executor. This happens in createApolloGateway. Schema creation is not needed because Apollo doesn't handle subscriptions anymore.
Then I updated Apollo packages from apollo-server to @apollo/server in all tests, examples etc.
I also replaced Express GraphQL with GraphQL HTTP.
Then I updated GraphQL Yoga packages and its usage in the examples.

@changeset-bot
Copy link

changeset-bot bot commented Oct 10, 2023

🦋 Changeset detected

Latest commit: 0b04b56

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
graphql-modules Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Oct 10, 2023

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
graphql-modules 3.0.0-alpha-20231106133212-0b04b56e npm ↗︎ unpkg ↗︎

@github-actions
Copy link
Contributor

diff --git a/website/algolia-lockfile.json b/website/algolia-lockfile.json
index 9146307b..4dbdadec 100644
--- a/website/algolia-lockfile.json
+++ b/website/algolia-lockfile.json
@@ -224,7 +224,7 @@
         "anchor": "moduleconfig"
       }
     ],
-    "content": "f3f51ccec98335a6165e261708ff5231",
+    "content": "a6aff48d899f1401a65ced944b5ce3fd",
     "url": "https://www.the-guild.dev/graphql/modules/docs/api",
     "domain": "https://www.the-guild.dev/graphql/modules",
     "hierarchy": ["docs"],
@@ -596,7 +596,7 @@
         "anchor": "tutorial"
       }
     ],
-    "content": "e6552b6d40cb7bee9aa2fb831d17d53a",
+    "content": "850e4778bbb21aeba497553b6315dca5",
     "url": "https://www.the-guild.dev/graphql/modules/docs/get-started",
     "domain": "https://www.the-guild.dev/graphql/modules",
     "hierarchy": ["docs"],

@github-actions
Copy link
Contributor

💻 Website Preview

The latest changes are available as preview in: https://725ec798.graphql-modules.pages.dev

@@ -542,101 +541,6 @@ test('Operation scoped provider should be created once per GraphQL Operation', a
expect(loadSpy).toHaveBeenCalledWith(1);
});

test('Operation scoped provider should be created once per GraphQL Operation (Apollo Server)', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ardatan why it's deleted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it because we don't have createSchemaForApollo anymore but now I've added it back by using Apollo Server itself.

typeDefs: Application['typeDefs'];
createExecution: Application['createExecution'];
}): Application['createApolloGateway'] {
return function createApolloGateway(options) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ardatan why do we have now createApolloGateway?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apollo removed executor so the only way of changing the executor is gateway, and it handles the schema as well.

Copy link
Collaborator

@kamilkisiela kamilkisiela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments. Can you explain the pull request a bit? You did a lot of changes but it's hard for me to understand what and why.

@ardatan
Copy link
Collaborator Author

ardatan commented Oct 18, 2023

I updated the description @kamilkisiela

@darkbasic
Copy link
Contributor

darkbasic commented Nov 4, 2023

Can you force push from darkbasic:apollo-v4 so that new alpha packages get created? I've tried to create a new pr but CI skipped the package creation step.

@enisdenjo
Copy link
Collaborator

@darkbasic rebased. New alpha versions will be available soon.

@darkbasic
Copy link
Contributor

@enisdenjo this is weird but somehow CI didn't get triggered: can you please manually re-run it?

@enisdenjo
Copy link
Collaborator

@darkbasic here it is 0b04b56.

@darkbasic
Copy link
Contributor

darkbasic commented Nov 6, 2023

Oh that's even weirder because somehow the bot didn't update the comment with the new packages: #2444 (comment)
I've just noticed the same happened on another PR when rebasing: accounts-js/accounts#1258 (comment)

@enisdenjo
Copy link
Collaborator

I just checked, the comment did get updated. Maybe the update was delayed? 🤔

Screenshot 2023-11-06 at 14 37 19

@darkbasic
Copy link
Contributor

darkbasic commented Nov 6, 2023

I guess it must be Github being slow because while before I couldn't even see the updated post now I can see it:
image

I'm pretty sure it didn't use to take two hours to update it but it looks like it's it's not something actionable on our end anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apollo 4 support
5 participants