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

GraphiQL crashes after adding a plugin #1103

Open
michal-wajrak opened this issue Jul 13, 2024 · 1 comment
Open

GraphiQL crashes after adding a plugin #1103

michal-wajrak opened this issue Jul 13, 2024 · 1 comment

Comments

@michal-wajrak
Copy link

michal-wajrak commented Jul 13, 2024

Adding a plugin to GraphiQL (in my case @graphiql/plugin-explorer), causes the /graphiql endpoint to crash.

Error shown in the console:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'umdPlugin')
    at main.js:145:78
    at Array.map (<anonymous>)
    at render (main.js:145:36)

index.ts:

const app = Fastify({
	logger: true,
});

const prisma = new PrismaClient();

app.register(mercurius, {
	schema,
	resolvers,
	context: () => {
		return { prisma };
	},
	graphiql: {
		enabled: true,
		plugins: [
			{
				name: "explorerPlugin",
				umdUrl: "https://unpkg.com/@graphiql/plugin-explorer/dist/index.umd.js",
			},
		],
	},
});

Dependencies:
"mercurius": "14.1.0"
"fastify": "4.28.1",
"node": "20.13.1"

mercurius-graphiql-plugin-issue

@mcollina
Copy link
Collaborator

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

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