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

@acrool/graphql-codegen-apollo-subscription

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acrool/graphql-codegen-apollo-subscription - npm Package Compare versions

Comparing version 3.0.1-test.6 to 3.0.1-test.7

39

dist/index.js

@@ -20,12 +20,17 @@ "use strict";

const allAst = (0, graphql_1.concatAST)(documents.map(v => v.document));
console.log('allAst', allAst);
const allFragments = [
...allAst.definitions.filter(d => d.kind === graphql_1.Kind.FRAGMENT_DEFINITION).map(fragmentDef => {
return {
node: fragmentDef,
name: fragmentDef.name.value,
onType: fragmentDef.typeCondition.name.value,
isExternal: false,
};
}),
...(config.externalFragments || []),
// ...(
// allAst.definitions.filter(
// d => d.kind === Kind.FRAGMENT_DEFINITION,
// ) as FragmentDefinitionNode[]
// ).map(fragmentDef => {
// return {
// node: fragmentDef,
// name: fragmentDef.name.value,
// onType: fragmentDef.typeCondition.name.value,
// isExternal: false,
// };
// }),
// ...(config.externalFragments || []),
];

@@ -35,16 +40,2 @@ const visitor = new visitor_1.ReactQueryVisitor(schema, allFragments, config, documents);

const visitorResult = (0, plugin_helpers_1.oldVisit)(allAst, { leave: visitor });
// 產生 Keys
const operationNames = documents.reduce((curr, row) => {
row.document.definitions.map(x => {
if ('name' in x && 'kind' in x && 'operation' in x) {
if (x.operation === 'query' && x.name.kind === 'Name') {
curr.queryKey.push(`${x.name.value} = '${x.name.value}'`);
}
if (x.operation === 'mutation' && x.name.kind === 'Name') {
curr.mutationKey.push(`${x.name.value} = '${x.name.value}'`);
}
}
});
return curr;
}, { queryKey: [], mutationKey: [] });
if (visitor.hasOperations) {

@@ -54,4 +45,2 @@ return {

content: [
`export enum EQueryKey{\n${operationNames.queryKey.join(',\n')}}`,
`export enum EMutationKey{\n${operationNames.mutationKey.join(',\n')}}`,
visitor.fragments,

@@ -58,0 +47,0 @@ ...visitorResult.definitions.filter(t => typeof t === 'string'),

{
"name": "@acrool/graphql-codegen-apollo-subscription",
"version": "3.0.1-test.6",
"version": "3.0.1-test.7",
"description": "react-query for graphql-code-generator",

@@ -5,0 +5,0 @@ "keywords": [

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