{"version":3,"file":"name.mjs","sources":["../../../../../src/lib/name.ts"],"sourcesContent":["import { type DocumentNode, Kind, type OperationDefinitionNode } from \"graphql\"\n\nexport function operationName(document: DocumentNode): string | null {\n  return (\n    document.definitions.find(\n      (node): node is OperationDefinitionNode =>\n        node.kind === Kind.OPERATION_DEFINITION && !!node.name,\n    )?.name?.value ?? null\n  )\n}\n\nexport function fragmentName(document: DocumentNode): string | null {\n  return (\n    document.definitions.find((node) => node.kind === Kind.FRAGMENT_DEFINITION)?.name?.value ?? null\n  )\n}\n"],"names":[],"mappings":";AAEO,SAAS,cAAc,UAAuC;;AACnE,WACE,oBAAS,YAAY;AAAA,IACnB,CAAC,SACC,KAAK,SAAS,KAAK,wBAAwB,CAAC,CAAC,KAAK;AAAA,EAAA,MAFtD,mBAGG,SAHH,mBAGS,UAAS;AAEtB;AAEO,SAAS,aAAa,UAAuC;;AAEhE,WAAA,oBAAS,YAAY,KAAK,CAAC,SAAS,KAAK,SAAS,KAAK,mBAAmB,MAA1E,mBAA6E,SAA7E,mBAAmF,UAAS;AAEhG;"}