Skip to content

Get context in interface field resolvers #748

Closed
@stijnfrishert

Description

@stijnfrishert

One of my interface's fields resolves to another type. I'd like to store that field as an ID and retrieve it from my context upon resolution. Whenever I try this, I get an error saying the trait bound FromInputValue is not satisfied for my context.

struct Event {
    parent: Option<ID>,
}

juniper::graphql_interface!(Event: Context |&self| {
    field parent(context: &Context) -> Option<Event> { ... }

    // ...
}

This leads me to believe this is simply not supported in the current 0.14.2 release. Is this something I should also wait for in the new interface release that's coming up, or am I missing something?

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