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

Generated schema included all resolvers when using inversifyjs container #622

Closed
xinghul opened this issue May 2, 2020 · 2 comments
Closed
Labels
Duplicate 🔑 This issue or pull request already exists

Comments

@xinghul
Copy link

xinghul commented May 2, 2020

Describe the Bug
Not sure if this is a bug, probably a feature request instead.

I have a use case where I want to separate resolvers into 2 groups: admin resolvers and public resolvers, and generate two different schemas.
However, I noticed that the public schema generate contained all the resolvers(including the private admin resolvers).
Here's the code snippet for generating public schema:

const schema = await TypeGraphQL.buildSchema({
  resolvers: values(publicResolvers),
  emitSchemaFile: {
    path: path.join(__dirname, '../../schema.public.gql'),
    commentDescriptions: true,
  },
});

publicResolvers only contains the public resolvers, but I do have all the resolvers binded to a container(inversifyjs), looks like the container resolvers took precedence, that might be the reason why.

Is there a way to generate the schema based the resolvers passed in?

Thanks!

@MichalLytek
Copy link
Owner

MichalLytek commented May 2, 2020

Please fill the bug report issue form as it may contain valuable info really needed in order to be able to help you.

@MichalLytek MichalLytek added Need More Info 🤷‍♂️ Further information is requested Question ❔ Not future request, proposal or bug issue labels May 2, 2020
@MichalLytek
Copy link
Owner

MichalLytek commented May 2, 2020

It's obviously a duplicate of #110 which is fixed in type-graphql@beta, so closing this one 🔒

@MichalLytek MichalLytek added Duplicate 🔑 This issue or pull request already exists and removed Need More Info 🤷‍♂️ Further information is requested Question ❔ Not future request, proposal or bug issue labels May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate 🔑 This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants