Skip to content

Link does not resolve on Union types #149

@n4mespace

Description

@n4mespace

When I tried to create a query with a link within a Union type, got an unexpected error

example query

    query SearchMedia($text: String) {
      searchMedia(text: $text) {
        __typename
        ... on Audio {
          duration
          user {
            id
          }
        }
        ... on Video {
          thumbnailUrl(size: 100)
        }
      }
    }

example error

"Cannot query field 'user' on type 'Media'. "
"Did you mean to use an inline fragment on 'Audio' or 'Video'?"

another libraries, like strawberry allow such a behavior, GraphQL doc also says it's valid

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions