Closed sikanhe closed 4 years ago
@sikanhe I am curious whether this kills the pattern where you can define partial contexts for your resolvers (and therefore hide all the stuff on the context object a specific resolver should not care about). Then when composing the schema a context object that satisfies all resolvers must be provided.
@n1ru4l I am not aware of what a partial context is, is this something new? It would be great to get a concret example with code or link to some other example on the internet.
Does partial just mean a subset of a full app context in terms of typescript?
Example of defining partial context and still accepted by schema because of Structural typing for TS, is this what you're talking about?
This PR implements a factory function for make an object that holds all type helpers. The benefit is that you can set the context type on this builder function once, and all your schema type creators gets the correct context without manually asserting them.