Skip to content

Change context object #1060

@mykytamykhailenko

Description

@mykytamykhailenko

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions