serverless-offline: typedefs being imported many times >.< #443
Labels
Duplicate 🔑
This issue or pull request already exists
Question ❔
Not future request, proposal or bug issue
Solved ✔️
The issue has been solved
When I run
>serverless offline
in my terminal, it creates an http endpoint and a websocket endpoint. I make a request to the HTTP endpoint, type-graphql tries to build the schema but fails with the age old error.Error: Schema must contain uniquely named types but contains multiple types named "User".
I comment out most of the code in the lambda function that is the websocket endpoint and run
serverless offline
again. Everything works.I've narrowed down the issue to the typedefs being "imported" multiple times (probably due to there being either 2 endpoints or 2 functions - currently I have only 1 function per endpoint).
Here is how it looks when it works (imports commented out).


Here is how it looks when I import a typedef from the websocket endpoint. Definitely imported multiple times...


And the error

Maybe this is a question for serverless-offline... What do you guys think? What is the problem with the typedefs being imported multiple times? Is there something I can do to stop this?
The text was updated successfully, but these errors were encountered: