Type GraphQL doesn't allow converting a class to a schema #1061
Labels
Community 👨👧
Something initiated by a community
Duplicate 🔑
This issue or pull request already exists
Type GraphQL exposes the
buildSchema
function but only works with resolvers. It must have some internal function that converts the class into a schema but it is not exposed at all, so I cannot opt-out of having a resolver. My use case is that I want to have a transportable schema (class -> string) that I can reuse elsewhere, but I don't want the resolver.In theory this should be working without adding extra functionality, but it is not exposed, at least I didn't find it. (It would also be useful if Type GraphQL had reference documentation.
I tried creating a JSON Schema from my class and coverting it to a GraphQL schema. This worked for simple cases, but I didn't find a tool that supports
$ref
s, and I have them in my code.The project I'm working on consists of an SDK where you can register your schemas, and send your data based on this schema, and a server component that aggregates data from multiple services. For this reason, I need programmatic control over what is created and how, and I can't have resolvers in the SDK (I will have a central resolver on the backend instead).
The text was updated successfully, but these errors were encountered: