使用 reason-apollo 时如何重命名变量(bs.as 样式)?

How to rename variables (bs.as style) when using reason-apollo?

我 运行 对使用变量 end 的模式进行 reason-apollo 查询,该变量在 ReasonML 中保留。我设置了这样的类型:

type endContainer {
  [bs.as "end"]
  end_
};

但不确定要在我的 graphql 查询中放入什么:

endContainer @bsRecord {
  end_ // Doesn't work ("unknown field")
  end  // Doesn't work either ("the record field end cannot be found")
}

bs.as 修饰符是否可能仅在 JS 互操作中可用但 apollo 未使用?

您必须为 end 使用别名:

endContainer @bsRecord {
  end_: end
}