platformatic: GraphQL printSchema error: field config must be an object
Hey! 👋🏼
Running Platformatic on a PostgreSQL DB I encountered an error that Platformatic doesn’t catch:
Error: MyschemaTemplate.mytable field config must be an object.
at mapperToGraphql (poc-platformatic/node_modules/@platformatic/sql-graphql/index.js:125:11)
at Plugin.exec (poc-platformatic/node_modules/avvio/plugin.js:130:19)
at Boot.loadPlugin (poc-platformatic/node_modules/avvio/plugin.js:272:10)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
You can see the table structure here and reproduce it running the command on this repo.
Related to this issue, I opened a PR to catch this error on Platformatic.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (17 by maintainers)
OK, this makes sense. We probably don’t use the schema in constraint name when we have schemas.
Closing in favor of https://github.com/platformatic/platformatic/issues/580
@rozzilla I can confirm I cannot even create these tables:
Given that this seems to a DB issue, any chance to have this solved on DB definition? ASSUMING that “table1”.“id” is unique, it should be enough to simply add a UNIQUE constraint or a
PRIMARY KEY ("id"):If this is not possible, maybe we can find some workaround…but we need to reproduce the problem first (currently, I cannot create such schema).
Hey @marcopiraccini, if you can yes please 🙏🏼 Last week I didn’t have the time to take a look into it