graphql-ppx icon indicating copy to clipboard operation
graphql-ppx copied to clipboard

Inline fragment inside a fragment doesn't work

Open johnridesabike opened this issue 4 years ago • 4 comments

fragment Html on Node {
  ... on MarkdownRemark {
    __typename
    html
  }
}

The compiler fails with this message:

Error: Inline fragments are not yet supported

However, using the inline fragment inside a regular query works as expected:

query {
  foo {
    bar {
      ... on MarkdownRemark {
        __typename
        html
      }
    }
  }
}

That query compiles without error.

johnridesabike avatar Aug 12 '20 21:08 johnridesabike

Thanks for getting this on the radar! Should be supported in fragments as well indeed!

jfrolich avatar Aug 13 '20 05:08 jfrolich

Inline fragments are not yet supported except when being used in interfaces.

jfrolich avatar Aug 15 '20 07:08 jfrolich

I've been avoiding inline fragments in my codebase because of lack of support, but I just came across a situation where not having them results in some duplication that will be hard to maintain. Is there a chance we can expect this feature to be available soon?

vknez avatar May 09 '21 17:05 vknez

PR is welcome :)

jfrolich avatar May 10 '21 01:05 jfrolich