尝试取消屏蔽具有参数

时间:2018-04-04 10:32:12

标签: relayjs relay relaymodern

我收到了以下问题:

query ChatRefetchContainerRefetchQuery(
  $arg: ID!
  $arg2: Boolean!
) {
  ...PeopleFragment
    @arguments(arg: $arg, arg2: $arg2)
}

我想要的东西是取消屏蔽片段的ContainerFragment数据OUTSIDE。通常您可以使用@relay(mask: false),但是中继编译器会出错,并显示以下消息:

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

查询错误:

query ChatRefetchContainerRefetchQuery(
      $arg: ID!
      $arg2: Boolean!
    ) {
      ...PeopleFragment
        @arguments(arg: $arg, arg2: $arg2)
        @relay(mask: false)
    }

1 个答案:

答案 0 :(得分:-1)

修复它的唯一方法就是

query ChatRefetchContainerRefetchQuery( $arg: ID! $arg2: Boolean! ) { Peoples @arguments(arg: $arg, arg2: $arg2) { ...PeopleFragment @relay(mask: false) } }