Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change context object #1060

Open
mykytamykhailenko opened this issue Sep 21, 2023 · 0 comments
Open

Change context object #1060

mykytamykhailenko opened this issue Sep 21, 2023 · 0 comments

Comments

@mykytamykhailenko
Copy link

Hi

It would be quite useful if there would a possibility to change the type of the contexts.
So, currently if you have following query:

      val dataInputType: ObjectType[AlternativeContext, Data] = ???
 fields[Context, Unit](
      Field(
        name      = "getData",
        fieldType = dataInputType,
        resolve = c => {
          val fetchSomeData = ???

          UpdateCtx(fetchSomeData)(data => AlternativeContext(data))
        }
      )
)

It would not compile, because you have to use Context

The strange thing is that dataInputType depends on AlternativeContext, yet you still need to adhere to Context

Basically, what I want to achieve is to reduce the contexts size during downstream flow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant