Type Subscription must define one or more fields
See original GitHub issueHey 👋🏼 Support for multiple schemas works well! 🚀
The issue I encountered was only this one:
GraphQLError: Type Subscription must define one or more fields.
at SchemaValidationContext.reportError (poc-platformatic/node_modules/graphql/type/validate.js:73:7)
at validateFields (poc-platformatic/node_modules/graphql/type/validate.js:271:13)
at validateTypes (poc-platformatic/node_modules/graphql/type/validate.js:244:7)
at validateSchema (poc-platformatic/node_modules/graphql/type/validate.js:43:3)
at Object.<anonymous> (poc-platformatic/node_modules/mercurius/index.js:193:36)
at poc-platformatic/node_modules/fastify/lib/hooks.js:152:22
at _encapsulateThreeParam (poc-platformatic/node_modules/avvio/boot.js:557:7)
at Boot.timeoutCall (poc-platformatic/node_modules/avvio/boot.js:453:5)
at Boot.callWithCbOrNextTick (poc-platformatic/node_modules/avvio/boot.js:435:19)
at Task.release (poc-platformatic/node_modules/fastq/queue.js:149:16) {
path: undefined,
locations: [ { line: 220, column: 1 } ],
extensions: [Object: null prototype] {}
}
I was able to skip it since I’m not interested yet in subscriptions, disabling them with the config core.events
set to false
.
Anyway, I think in this case plaformatic
doesn’t catch the error, that popped up in the graphql
library and so it’s quite hard to understand. Debugging it locally I was able to follow the function calls until they arrived at the process.nextTick
inside avvio.
It’s doable to catch and log this error inside platformatic
? 😊
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Type Mutation must define one or more fields #390 - GitHub
Type Mutation must define one or more fields. My server currently does not support any mutations, and is purely used for data retrieval....
Read more >Input Object type `TypeName` must define one or more fields
Here I am trying to reuse BaseCat in CatObjectType and CatInputType . But I getting this error: [ { GraphQLError: Input Object type...
Read more >GraphQL schema basics - Apollo GraphQL Docs
Most of the schema types you define have one or more fields: ... This includes the three special root operation types: Query ,...
Read more >type-graphql/Lobby - Gitter
I want to run a custom graphql server infront of it and modify some functionalities like sending an email during user creation. But...
Read more >GraphQL error: Schema does not pass validation "must define ...
n\nObject type 'PageBodyImage_gridDefaultSlice' must define one or more fields. ... must define one or more fields.\n\nObject type ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fix is there: https://github.com/platformatic/platformatic/pull/395
Ah I know what the problem is, a fix is incoming.