-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat(graphql): add an extension for type-graphql integration #5545
Conversation
d03365f
to
fc7fbaf
Compare
4kLOC of new code, that's a big chunk to review. Who else can help with reviewing this new feature? @raymondfeng @dhmlau |
+1 for depending on a 3rd-party library and not inventing our own solution. I have few high-level questions:
|
extensions/graphql/src/__tests__/fixtures/graphql-test/src/services/recipe.service.ts
Outdated
Show resolved
Hide resolved
Talked to @hacksparrow, he will review this as well. Thanks @hacksparrow! |
@bajtos Thank you for the feedback.
I also take this opportunities to find limitation of type-graphql. For example, it uses a global registry for resolver metadata, which is problematic for us with the ability to start/stop applications.
I'm not there yet. It's my priority to get the right programming model in place 1st.
That seems to be possible. We can follow what we did for REST CRUD controllers. For example, generating resolver classes from models and relations. |
Makes sense. Unfortunately, this was not clear to me from reading the pull request description and skimming through the docs.
Sure, I am fine to focus on getting right the programming model first. I just want to avoid the situation where we settle on a programming model that will make it very difficult to optimize the underlying implementation for a good performance.
+1 I think we should also investigate how to build GraphQL schemas from our BTW, regarding SELECT 1+N problem and DataLoaders, here is a short video explaining both the issue and a possible solution: https://www.youtube.com/watch?v=SSj4BGkIBGo |
The Global storage is not a problem, the standard JS If you have any questions, feel free to |
BTW, is the decorators renaming/reexporting intentional? Are you going to maintain your own docs to not confuse the people with redirecting to |
dd5c408
to
328bfa1
Compare
8db9e08
to
bc8433c
Compare
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.
I am afraid I don't have bandwidth to keep up with the changes. I am fine to land this as an initial version and then iterate on any improvements needed.
Please review code coverage by tests, I see few files that have lower test coverage than is our current bar:
- resolver resolution - narrow down by key: https://coveralls.io/builds/33198782/source?filename=extensions%2Fgraphql%2Fsrc%2Fgraphql.container.ts#L85
- verify handling of express options: https://coveralls.io/builds/33198782/source?filename=extensions%2Fgraphql%2Fsrc%2Fgraphql.server.ts#L76
- it looks like there is no test loading the graphql example
index.ts
file: https://coveralls.io/builds/33198782/source?filename=examples%2Fgraphql%2Fsrc%2Findex.ts#L11
This is needed for GraphQL integration as a REST middleware to access the RequestContext for Dependency Injection. Signed-off-by: Raymond Feng <[email protected]>
Signed-off-by: Raymond Feng <[email protected]>
Signed-off-by: Raymond Feng <[email protected]>
Signed-off-by: Raymond Feng <[email protected]>
This PR adds an extension package to provide GraphQL integration using type-graphql.
https://github.com/strongloop/loopback-next/blob/graphql/extensions/graphql/README.md
Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated👉 Check out how to submit a PR 👈