-
Notifications
You must be signed in to change notification settings - Fork 65
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
Force plugins to be explicitely enabled #503
Comments
UpdateAfter discussing that topic with @jasonkuhrt, we ended up with the following API: Enable nexus-prisma-plugin import { plugins } from 'nexus-future'
import nexusPluginPrisma from 'nexus-plugin-prisma'
plugins.use(nexusPluginPrisma({ /* optional configuration */ })) Enable Nexus Schema built-in plugins import { plugins } from 'nexus-future'
plugins.use(plugins.builtins.nullabilityGuard, ...) Local plugin: import { plugins } from 'nexus-future'
plugins.use((p) => {
/* ... */
}) This API has several benefits:
Notes
|
@Weakky Thanks for capturing these notes. I still have reservations about the functional things we would be losing. I'll try to write them up soon. Maybe some of the losses can be recouped. I'm not sure this API actually has all the touted benefits we think. There is a subjective argument to be sure, but I want to partition the objective from subjective so we can better appraise the tradeoffs. |
But for that, I think we should: settings.change({
schema: {
// options here for builtin schema component plugins
// user does not even know they are builtin schema component plugins
}
}) We have an existing system. If we think it's good, and we think a schema plugin is good enough to bundle, then I think we should merge them. |
Resolved by graphql-nexus/nexus@b0704dc |
Description
Right now, plugins are enabled by default as soon as they're in the
dependencies
of thepackage.json
.We should investigate ways to enable them only if they were explicitely enabled in some configs somewhere.
Notes
nexus.config.ts
) would make reading the config much easier/faster/saferThe text was updated successfully, but these errors were encountered: