Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type-graphql: Unable to infer from TypeSript reflection system #11166

Open
jupl opened this issue May 18, 2024 · 0 comments
Open

type-graphql: Unable to infer from TypeSript reflection system #11166

jupl opened this issue May 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jupl
Copy link

jupl commented May 18, 2024

What version of Bun is running?

1.1.8

What platform is your computer?

Darwin 23.4.0 x86_64 i386

What steps can reproduce the bug?

Given the sample code below:

import {Query, Resolver, buildSchemaSync} from 'type-graphql'

@Resolver()
class TestResolver {
  @Query()
  field(): string {
    return 'Test'
  }
}

buildSchemaSync({resolvers: [TestResolver]})

And given the following dependencies:

  • type-graphql
  • reflect-metadata

And given the following options set for tsconfig.json:

  • "emitDecoratorMetadata": true
  • "experimentalDecorators": true

I can run the code without issue in Node with TSNode. In Bun if I run:

bun run -r reflect-metadata [file.ts]

I get the error Unable to infer GraphQL type from TypeScript reflection system.. I have to change the Query line to what is below so it can run in Bun, which defeats a benefit of using TypeGraphQL to reduce writing redundant typing information.

  @Query(_type => String)

What is the expected behavior?

No errors when running script in Bun.

What do you see instead?

Unable to infer GraphQL type from TypeScript reflection system.

Additional information

No response

@jupl jupl added the bug Something isn't working label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant