Struggling with context creation in type script #3163
Replies: 1 comment 2 replies
-
Never mind I figure it out. I was still using an old type def within the resolvers which doesn't work with how I am now retrieving the authentication token. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am converting a Typescript Apollo server to Yoga and am having typing issues. In Apollo I was able to create a context callback which was called with every request. I assume this is equivalent to the User Context in Yoga.
Currently I have an asynchronous callback in the
createYoga
method:This based on the user context example. I create the schema using
createSchema
. The type error comes fromcreateSchema
.my call to
createSchema
for context:The type error is:
I have spent hours trying to find anything online and have come up empty handed. It does not help that all of the Typescript examples I can find for Yoga are multiple versions out of date.
I have very little Typescript experience so if this is blindingly obvious forgive me.
Beta Was this translation helpful? Give feedback.
All reactions