twenty / packages /twenty-server /src /engine /api /graphql /direct-execution /utils /graphql-build-partial-resolve-info.util.ts
Jules
Initial clean CRM deployment with prebuilt assets
d9494a5
Raw
History Blame Contribute Delete
359 Bytes
import {
type FieldNode,
type FragmentDefinitionNode,
type GraphQLResolveInfo,
} from 'graphql';
export const graphQLBuildPartialResolveInfo = (
field: FieldNode,
fragmentMap: Map<string, FragmentDefinitionNode>,
): Pick<GraphQLResolveInfo, 'fieldNodes' | 'fragments'> => ({
fieldNodes: [field],
fragments: Object.fromEntries(fragmentMap),
});