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

@inline fragments on unions does not work #400

Open
zth opened this issue Nov 6, 2022 · 0 comments
Open

@inline fragments on unions does not work #400

zth opened this issue Nov 6, 2022 · 0 comments

Comments

@zth
Copy link
Owner

zth commented Nov 6, 2022

Symptom: You have an @inline fragment on a union type, but you're never getting anything but #UnselectedUnionMember back. Example:

fragment MetricValueUtilsValue_value on MetricValues @inline {
    ... on MetricValueCount {
      count
    }
    ... on MetricValueCurrency {
      amount
    }
    ... on MetricValuePercentage {
      percentage
    }
  }

Cause: Automatic insertion of __typename selection seems to not work on @inline fragments on unions.

Current workaround: add the __typename selection yourself.

fragment MetricValueUtilsValue_value on MetricValues @inline {
+   __typename
    ... on MetricValueCount {
      count
    }
    ... on MetricValueCurrency {
      amount
    }
    ... on MetricValuePercentage {
      percentage
    }
  }
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