question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type Subscription must define one or more fields

See original GitHub issue

Hey 👋🏼 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:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mcollinacommented, Nov 25, 2022
0reactions
mcollinacommented, Nov 25, 2022

Ah I know what the problem is, a fix is incoming.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found