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 schema generation to be independent of driver start #2435

Merged
merged 3 commits into from
Feb 8, 2023

Conversation

CarsonF
Copy link
Contributor

@CarsonF CarsonF commented Oct 5, 2022

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Schema generation is done as apart of the driver start method and is only done if an http adapter is present.

Issue Number: #2433

What is the new behavior?

Schema generation is done before the driver start. It is done regardless of the presence of an http adapter.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@CarsonF CarsonF force-pushed the refactor/schema-generation-hook branch from af46747 to 9f8bc82 Compare October 5, 2022 15:30
public async generateSchema(
options: MercuriusDriverConfig,
): Promise<GraphQLSchema> {
return new GraphQLSchema({});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since gateways don't generate a schema, I stubbed it here & omitted below. Same for apollo gateway.

If this feels hacky, I could change return type to be nullable.

@CarsonF CarsonF force-pushed the refactor/schema-generation-hook branch from 9f8bc82 to 5903794 Compare November 30, 2022 04:43
@bneigher
Copy link

bneigher commented Dec 2, 2022

I think this fixes a bug I'm dealing with when trying to use ApolloFederationDriver

@kamilmysliwiec kamilmysliwiec mentioned this pull request Feb 6, 2023
4 tasks
@CarsonF CarsonF force-pushed the refactor/schema-generation-hook branch from 5903794 to 6408c1f Compare February 6, 2023 16:41
@kamilmysliwiec kamilmysliwiec changed the base branch from master to next February 8, 2023 08:49
@kamilmysliwiec kamilmysliwiec merged commit 2577291 into nestjs:next Feb 8, 2023
@kamilmysliwiec
Copy link
Member

LGTM

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.

3 participants