UNPKG

1.47 kBSource Map (JSON)View Raw
1{"version":3,"file":"index.esm.js","sources":["../../../dist/plugins/other/introspection/src/index.js"],"sourcesContent":["import { introspectionFromSchema } from 'graphql';\nimport { removeFederation } from '@graphql-codegen/plugin-helpers';\nimport { extname } from 'path';\nexport const plugin = async (schema, _documents, pluginConfig) => {\n const cleanSchema = pluginConfig.federation ? removeFederation(schema) : schema;\n const introspection = introspectionFromSchema(cleanSchema, { descriptions: true });\n return pluginConfig.minify ? JSON.stringify(introspection) : JSON.stringify(introspection, null, 2);\n};\nexport const validate = async (schema, documents, config, outputFile) => {\n if (extname(outputFile) !== '.json') {\n throw new Error(`Plugin \"introspection\" requires extension to be \".json\"!`);\n }\n};\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;AAGY,MAAC,MAAM,GAAG,OAAO,MAAM,EAAE,UAAU,EAAE,YAAY,KAAK;AAClE,IAAI,MAAM,WAAW,GAAG,YAAY,CAAC,UAAU,GAAG,gBAAgB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AACpF,IAAI,MAAM,aAAa,GAAG,uBAAuB,CAAC,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;AACvF,IAAI,OAAO,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACxG,EAAE;AACU,MAAC,QAAQ,GAAG,OAAO,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,KAAK;AACzE,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,OAAO,EAAE;AACzC,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,wDAAwD,CAAC,CAAC,CAAC;AACpF,KAAK;AACL;;;;"}
\No newline at end of file