confluentinc / ksqldb-graphql

Node.js GraphQL integration for ksqlDB
https://ksqldb.io/
Other
57 stars 15 forks source link

Make sure it works with references. #23

Open gklijs opened 3 years ago

gklijs commented 3 years ago

I have a demo setup where I use references, but it fails to configure the schema, likely because the same reference is used multiple times. This is the error I get

Could not generate schemas: Schema must contain uniquely named types but contains multiple types named "ADDRESS".
(node:27) UnhandledPromiseRejectionWarning: Error: Error: Unable to create schemas and resolvers
    at /root/app/dist/node_modules/@confluentinc/ksqldb-graphql/src/schema.js:201:27
    at Generator.next (<anonymous>)
    at fulfilled (/root/app/dist/node_modules/@confluentinc/ksqldb-graphql/src/schema.js:5:58)

Demo can be found at https://github.com/gklijs/ksqlDB-GraphQL-poc you probably need to restart the js-graphql-endpoint container to see the error.

gklijs commented 3 years ago

I investigated a bit more, but the issue also exist when using protobuf, but included a separate message, which get included in another message. I guess the best simple solution would be to check if the type is the same, and then to coerce them and/or only throw an error when it's not the same.