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

refactor(@whook/graphql): update Apollo server to the last major version #143

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

nfroidure
Copy link
Owner

fix #140

@nfroidure nfroidure requested a review from Oupsla November 8, 2022 09:38
@nfroidure nfroidure self-assigned this Nov 8, 2022
Copy link
Collaborator

@Oupsla Oupsla left a comment

Choose a reason for hiding this comment

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

LGTM
Any breaking change for users ? (Maybe the context injected ?)

@nfroidure
Copy link
Owner Author

@Oupsla yes, the main issue is with the context. In the previous version, the server were asking for a context function. In the new version, it is required at the http transaction level : https://github.com/nfroidure/whook/pull/143/files#diff-1eb63035ea7297ec70ff6178114f5f2b92254e9f3dad38f597be116d2c8080acR118-R122

I was wondering if I should change the newly create GRAPHQL_SERVER_CONTEXT service into a function to cover wider usages, WDYT? Do you use it currently?
https://github.com/nfroidure/whook/pull/143/files#diff-1eb63035ea7297ec70ff6178114f5f2b92254e9f3dad38f597be116d2c8080acR84

@Oupsla
Copy link
Collaborator

Oupsla commented Nov 8, 2022

I was wondering if I should change the newly create GRAPHQL_SERVER_CONTEXT service into a function to cover wider usages, WDYT?

Maybe to stay compatible with the previous context function it could be nice.
At the moment, I only use the context to clear graphQL loaders between each calls

async function initGraphQLServerConfig({
  graphQLLoaders,
}: {
  graphQLLoaders: GraphQLLoadersService;
}) {
  (...)

  return {
    context: async (context) => {
      await graphQLLoaders.clearAllLoaders();
      return context;
    },
   (...)
  };
}

@nfroidure
Copy link
Owner Author

@Oupsla ok, I'll fix this before merging. Thanks for your feedback

@nfroidure nfroidure merged commit 1b11284 into master Nov 9, 2022
@nfroidure nfroidure deleted the refactor/graphql branch November 9, 2022 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

apollographql/apollo-server breaks the build
2 participants