Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@graphql-codegen/urql-introspection

Package Overview
Dependencies
Maintainers
5
Versions
228
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-codegen/urql-introspection - npm Package Compare versions

Comparing version 1.0.0-alpha-c879d7d4.0 to 1.0.0

12

index.cjs.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc