facebook/relay

Invariant violation calling `useFragment` with inline fragment

anmonteiro opened this issue · 0 comments

Is it expected that calling useFragment on a fragment marked with @inline throws an invariant violation?

In other words, shouldn't isFragment also account for RelayConcreteNode.INLINE_DATA_FRAGMENT?

function isFragment(node: GraphQLTaggedNode): boolean {
const fragment = getNode(node);
return (
typeof fragment === 'object' &&
fragment !== null &&
fragment.kind === RelayConcreteNode.FRAGMENT
);
}