-
Notifications
You must be signed in to change notification settings - Fork 152
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
Asynchronous schema generation and OGM initialization #896
Conversation
Thanks for the documentation updates. The preview documentation has now been torn down - reopening this PR will republish it. |
Great that this is happening. I guess this means you'll be going for a new major release reasonably soon. Any idea of roughly when the release is scheduled? |
Hey @wheresrhys! We wouldn't normally give timelines, but this release has a fairly strict schedule, so you can expect this next week! 🙂 It won't be as much of a jarring release as 2.0.0, but certainly some nice changes to come. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the solution looks solid, I just commented on a few style/legibility suggestions and improvements
Co-authored-by: angrykoala <angrykoala@outlook.es>
Co-authored-by: angrykoala <angrykoala@outlook.es>
Co-authored-by: angrykoala <angrykoala@outlook.es>
@@ -128,6 +128,50 @@ class Neo4jGraphQL { | |||
await assertIndexesAndConstraints({ driver, driverConfig, nodes: this.nodes, options: input.options }); | |||
} | |||
|
|||
private wrapResolvers(resolvers: IResolvers, { schema }: { schema: GraphQLSchema }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (non-blocking): Maybe we could move these functions to the bottom?
Usually, it is slightly easier to read functions in a class from more abstract to less abstract (kind of like articles are composed). So, first, we read generateSchema
at the top, and then, if we need to, we keep going to the functions that are used by that one
Description
This PR moves the heavy lifting of the
Neo4jGraphQL
andOGM
constructors into asynchronous functions,getSchema()
andinit()
, respectively.This means that construction will be quick and these functions will have to be awaited following construction. Whilst this may seem like a nuisance right now, in the future this will open doors to more performant schema generation through asynchronous processing.
Checklist
The following requirements should have been met (depending on the changes in the branch):