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

Can't use a custom Pothos plugin - "Failed to extract schema: No plugin named myPlugin was registered" #3772

Open
dallonf opened this issue May 23, 2024 · 3 comments

Comments

@dallonf
Copy link
Contributor

dallonf commented May 23, 2024

Here's a minimal repro: https://github.com/dallonf/sst-pothos-plugin-repro

It includes a straightforward custom Pothos plugin that doesn't actually do anything visible.

When running with npm run dev, I get this error:

✖ Pothos: Failed to extract schema:
No plugin named myPlugin was registered

And looking at the generated out.mjs file, it indeed is missing the plugin registration, only including the constant name itself:

var pluginName = "myPlugin";
// packages/functions/src/graphql/builder.ts
import SchemaBuilder2 from "@pothos/core";

// packages/functions/src/graphql/MyPlugin/index.ts

var MyPlugin_default = pluginName;
// packages/functions/src/graphql/builder.ts
var builder = new SchemaBuilder2({
  plugins: [MyPlugin_default]
});

I would expect to be able to write custom Pothos plugins in an SST project!

@jayair
Copy link
Contributor

jayair commented May 23, 2024

Not sure when we'll get to this because of Ion but happy to review PRs for it.

@dallonf
Copy link
Contributor Author

dallonf commented May 24, 2024

Out of curiosity, does this issue not exist in Ion?

@jayair
Copy link
Contributor

jayair commented May 28, 2024

We haven't really added Pothos support there yet.

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

No branches or pull requests

2 participants