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

[Modern] FlattenTransform: Cannot flatten fragment spread %s with arguments. Use the ApplyFragmentArgumentTransform before flattening #2118

Open
joonhocho opened this issue Sep 22, 2017 · 9 comments
Labels

Comments

@joonhocho
Copy link

joonhocho commented Sep 22, 2017

I am getting this error:
https://github.com/facebook/relay/blob/master/packages/relay-compiler/graphql-compiler/transforms/FlattenTransform.js#L160

Could someone explain how to use suggested ApplyFragmentArgumentTransform ?

I could not find any examples or documents regarding ApplyFragmentArgumentTransform.

@nikhildaga
Copy link

Facing the same issue.

@chungwong
Copy link

chungwong commented Mar 19, 2018

I am having the same issue. My use case was trying to add @relay(mask: false) onto a fragment and got an error.

ERROR:
RelayMaskTransform: Cannot unmask fragment spread `A_viewer` with arguments. Use the 'ApplyFragmentArgumentTransform' before flattening

and the query is like this

  query {
    viewer {
      ...A_viewer @relay(mask: false) @arguments(...)
    }
  }

@sibelius
Copy link
Contributor

try this

...A_viewer @arguments(...) @relay(mask: false)

@chungwong
Copy link

Do you mean moving @relay(mask: false) to the end?
I tried but the error didn't go away.

@jamesone
Copy link

Did you figure this out? I am facing the same issue

@jamesone
Copy link

jamesone commented Apr 4, 2018

I've put a question up here: https://stackoverflow.com/questions/49648794/error-when-trying-to-unmask-relay-modern-fragment-that-has-arguments

Hopefully we can get to the bottom of this 💪

@jantoebes
Copy link

the only way to fix it is like

  query {
    viewer {
      A_viewer @arguments(...) {
        ...A_viewer_fragment  @relay(mask: false)
      }
    }
  }

so you can the share the properties of the viewer fragment but not the total fragment

@novito
Copy link

novito commented Nov 16, 2018

@jantoebes would you mind explaining that solution? I don't understand that if A is a fragmented component you can just do A_viewer without the spread? Also, later you do ...A_viewer_fragment, but what is that _fragment? Thanks

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants