Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Type-graphql issue #5

Open
MirrorBytes opened this issue Mar 30, 2021 · 10 comments
Open

Type-graphql issue #5

MirrorBytes opened this issue Mar 30, 2021 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@MirrorBytes
Copy link
Contributor

Type reflection seems to be buggy. I'm getting random errors like this:

"Unable to infer GraphQL type from TypeScript reflection system. You need to provide explicit type for 'XXXX' of 'XXXX' class."

This is happening with reflect-metadata being imported in the endpoint and the schema file. Importing it into each individual class file doesn't seem to work either. Any ideas?

@babichjacob
Copy link
Member

Do you need to enable "emitDecoratorMetadata": true somewhere in TSConfig?

@babichjacob babichjacob added the bug Something isn't working label Mar 30, 2021
@MirrorBytes
Copy link
Contributor Author

@babichjacob Already done, along with "experimentalDecorators" being set to true. It's doing it for Entities and Resolvers

@babichjacob
Copy link
Member

Can you provide a repository?

@MirrorBytes
Copy link
Contributor Author

MirrorBytes commented Mar 30, 2021

@babichjacob Sorry, had to create one: https://github.com/MirrorBytes/phorm-kit-vercel
I trimmed a bit out, including the database connection.

@babichjacob
Copy link
Member

I'll have to leave this issue open for a few days because school has to be a higher priority right now. I'm sorry.

@MirrorBytes
Copy link
Contributor Author

No need to be sorry!
I can't seem to figure out if this is a problem with decorators and metadata in sveltekit or specifically graphql.

@MirrorBytes
Copy link
Contributor Author

@babichjacob

So, I moved the graphql implementation to the api directory that vercel uses, and changed the function to a vercel centric one. It stills errors.

However, if I ditch graphql-helix and use apollo-server-micro, everything works as expected. I believe this is an issue with graphql-helix not liking type-graphql and/or metadata reflection.

I'll update the repo in a little bit incase anyone else has this issue.

@MirrorBytes
Copy link
Contributor Author

Wait, I lied. This has nothing to do with graphql-helix. It's to do with sveltekit and type reflection, just tried to move it out of the api directory, and it's doing the exact same thing.

@MirrorBytes
Copy link
Contributor Author

I opened an issue in the SvelteKit repo as I think it pertains to that as opposed to this library: sveltejs/kit#798

@babichjacob babichjacob self-assigned this Apr 1, 2021
@babichjacob
Copy link
Member

Relevant upstream issue / comment: sveltejs/kit#1327 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants