I was expecting the schema to be exportable using the makeWrapPlansPlugin.
Actual results
The schema can't be exported.
Additional context
I would like to help on this issue but it might be out of my current knowledge of the project as I just started with it a few weeks ago.
Full error:
Error: Attempting to export an instance of a class; you should wrap this definition in EXPORTABLE! (Class: class GraphQLNonNull {
constructor(ofType) {
isNullableType(ofType) ||
(0, _devAssert.devAssert)(
false,
`Expected ${(0, _inspect.inspect)(
ofType,
)} to be a GraphQL nullable type.`,
);
this.ofType = ofType;
}
get [Symbol.toStringTag]() {
return 'GraphQLNonNull';
}
toString() {
return String(this.ofType) + '!';
}
toJSON() {
return this.toString();
}
})
at _convertToAST (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:596:19)
at handleSubvalue (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:571:25)
at /Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:603:30
at Array.forEach (<anonymous>)
at _convertToAST (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:601:17)
at handleSubvalue (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:571:25)
at /Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:603:30
at Array.forEach (<anonymous>)
at _convertToAST (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:601:17)
at handleSubvalue (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:571:25)
at /Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:603:30
at Array.forEach (<anonymous>)
at _convertToAST (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:601:17)
at convertToIdentifierViaAST (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:698:9)
at /Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:771:16
at Array.map (<anonymous>)
at factoryAst (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:753:39)
at importWellKnownOrFactory (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:682:16)
at convertToIdentifierViaAST (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:697:17)
at handleSubvalue (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:565:25)
at /Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:603:30
at Array.forEach (<anonymous>)
at _convertToAST (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:601:17)
at handleSubvalue (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:571:25)
at /Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:603:30
at Array.forEach (<anonymous>)
at _convertToAST (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:601:17)
at convertToIdentifierViaAST (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:698:9)
at extensions (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:719:12)
at /Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:361:33
at Array.reduce (<anonymous>)
at CodegenFile.makeObjectFields (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:345:44)
at CodegenFile.makeTypeDeclaration (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:417:60)
at CodegenFile.declareType (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:281:33)
at /Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:924:21
at Array.map (<anonymous>)
at exportSchemaGraphQLJS (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:923:31)
at exportSchemaAsString (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:1131:9)
at exportSchema (/Users/florentcollin/dev/software/ouch-my-finger/node_modules/graphile-export/dist/exportSchema.js:1224:28)
at main (file:///Users/florentcollin/dev/software/ouch-my-finger/export-schema.mjs:8:9)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Summary
Using the
makeWrapPlansPlugin
creates an error when trying to export the schema withgraphile-export
.Steps to reproduce
I have created a commit with a reproduction of the error https://github.com/FlorentCollin/ouch-my-finger/commit/b41edecaceba1dffbeee982138e5d11f031ef7de
The plugin I tested was the following
This version also has the same error.
Basically running
node export-schema.mjs
results in the following error (the full error is available in Additional context)However the
makeExtendsSchemaPlugin
seems to be exportable with the following plugin so onlymakeWrapPlansPlugin
can't be exported.Expected results
I was expecting the schema to be exportable using the
makeWrapPlansPlugin
.Actual results
The schema can't be exported.
Additional context
I would like to help on this issue but it might be out of my current knowledge of the project as I just started with it a few weeks ago.
Full error: