Skip to content

GraphiQL crashes after adding a plugin #1103

@michal-wajrak

Description

@michal-wajrak

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions