Skip to content

A union of interface and something else is not resolvable #1909

@MeRuslan

Description

@MeRuslan

Strawberry cannot process a type of Union[strawberry_interface, strawberry_type]

System Information

Macos, latest strawberry (0.111.2 at the moment)

Additional Context

Sample code:

from typing import Union

import strawberry


@strawberry.interface
class Node:
    id: strawberry.ID


@strawberry.type
class Error:
    message: str


@strawberry.type
class Query:
    users: Union[Node, Error]


schema = strawberry.Schema(query=Query)

Fails with
TypeError: Query fields cannot be resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions