@graphql-codegen/urql-introspection
Advanced tools
Comparing version 1.0.0-alpha-c879d7d4.0 to 1.0.0
@@ -26,13 +26,7 @@ 'use strict'; | ||
const defaultExportStatement = config.module === 'es2015' ? `export default` : 'module.exports ='; | ||
return ` | ||
${defaultExportStatement} ${content} | ||
`; | ||
return `${defaultExportStatement} ${content}`; | ||
} | ||
if (extensions.ts.includes(ext)) { | ||
return ` | ||
import { IntrospectionQuery } from 'graphql'; | ||
const result: IntrospectionQuery = ${content}; | ||
export default result; | ||
`; | ||
return `import { IntrospectionQuery } from 'graphql'; | ||
export default ${content} as unknown as IntrospectionQuery;`; | ||
} | ||
@@ -39,0 +33,0 @@ throw new Error(`Extension ${ext} is not supported`); |
import { PluginFunction, PluginValidateFn } from '@graphql-codegen/plugin-helpers'; | ||
/** | ||
* @description This plugin generates an introspection file but only with Interfaces and Unions, based on your GraphQLSchema. | ||
* @description This plugin generates an introspection file for Schema Awareness feature of Urql Cache Exchange | ||
* | ||
* If you are using `urql` and your schema contains `interface` or `union` declaration, it's recommended to use provide an introspection to enable Schema Awareness. | ||
* | ||
* You can read more about it in `urql` documentation: https://formidable.com/open-source/urql/docs/graphcache/schema-awareness/. | ||
@@ -8,0 +6,0 @@ * |
@@ -22,13 +22,7 @@ import { extname } from 'path'; | ||
const defaultExportStatement = config.module === 'es2015' ? `export default` : 'module.exports ='; | ||
return ` | ||
${defaultExportStatement} ${content} | ||
`; | ||
return `${defaultExportStatement} ${content}`; | ||
} | ||
if (extensions.ts.includes(ext)) { | ||
return ` | ||
import { IntrospectionQuery } from 'graphql'; | ||
const result: IntrospectionQuery = ${content}; | ||
export default result; | ||
`; | ||
return `import { IntrospectionQuery } from 'graphql'; | ||
export default ${content} as unknown as IntrospectionQuery;`; | ||
} | ||
@@ -35,0 +29,0 @@ throw new Error(`Extension ${ext} is not supported`); |
{ | ||
"name": "@graphql-codegen/urql-introspection", | ||
"version": "1.0.0-alpha-c879d7d4.0", | ||
"version": "1.0.0", | ||
"description": "graphql-code-generate plugin for generating fragments matcher introspection file", | ||
@@ -5,0 +5,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
13083
114