Generate types for Hive gateway injected context operations #10462
Unanswered
JMartinCollins
asked this question in
Ideas
Replies: 1 comment
-
Hello, this is what the team calls Is this something you'd like to try and implement? |
Beta Was this translation helpful? Give feedback.
0 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.
Uh oh!
There was an error while loading. Please reload this page.
-
I have looked around quite a bit and haven't found any solution for this, which indicates to me that it might not exist yet. When setting up the Hive gateway config, I can generate a
Resolvers
type (typescript-resolvers
) from the schema as well as a Context type which can extend the baseGatewayContext
from Hive gateway. However, the context is still missing types for a major part of the api, which is the functions that are injected by Hive at runtime:The image above is an example of one of the functions I'm referring to, accessed on
context.{Subgraph}.{Type}.{operationName}
.To me the closest thing to this is the generated
Resolvers
(of whichQueryResolvers
is a part), which you can see I tried to use in the image above, but it also isn't the correct type. It almost seems like there would be a "Hive injected operations" codegen plugin for this purpose. Any clues or is this still a non-existent feature?In absence of end-to-end static type safety it's hard to justify building a critical piece of infrastructure like an api gateway/router with the tool.
Beta Was this translation helpful? Give feedback.
All reactions