import { GraphQLTaggedNode } from "relay-runtime"; import { ArrayKeyType, ArrayKeyTypeData, KeyType, KeyTypeData } from "./helpers"; // NOTE: These declares ensure that the type of the returned data is: // - non-nullable if the provided ref type is non-nullable // - nullable if the provided ref type is nullable // - array of non-nullable if the provided ref type is an array of // non-nullable refs // - array of nullable if the provided ref type is an array of nullable refs export function useFragment( fragmentInput: GraphQLTaggedNode, fragmentRef: TKey, ): KeyTypeData; export function useFragment( fragmentInput: GraphQLTaggedNode, fragmentRef: TKey | null | undefined, ): KeyTypeData | null | undefined; export function useFragment( fragmentInput: GraphQLTaggedNode, fragmentRef: TKey, ): ArrayKeyTypeData; export function useFragment( fragmentInput: GraphQLTaggedNode, fragmentRef: TKey | null | undefined, ): ArrayKeyTypeData | null | undefined;