npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

graphql-lint-unused-fields-clint

v1.6.1

Published

Clint-specific tool for detecting unused GraphQL fields

Readme

graphql-lint-unused-fields-clint

🎯 Clint-specific package - GraphQL Lint extension for detecting custom patterns in the Clint platform.

📦 Installation

npm install graphql-lint-unused-fields-clint

🎯 Clint-Specific Features

  • Hasura actions.graphql detection
  • Custom Clint patterns (clint.entity.method)
  • Automatic mapping (owner_get_nameclint.owner.getName)
  • Variable tracking with Clint-specific translations
  • Specific usage analysis for Clint architecture

🔗 Detected Patterns

GraphQL Actions → Code Usage

# actions.graphql
type Query {
  owner_get_name(id: uuid!): ResultStatusOutput
  user_get_profile(id: uuid!): UserProfile
  payment_process_order(data: OrderInput!): PaymentResult
}
// Usage in Clint code
const ownerName = await clint.owner.getName(id);
const userProfile = await clint.user.getProfile(userId);
const paymentResult = await clint.payment.processOrder(orderData);

🔍 Variable Tracking

Clint-Specific Translations

O sistema de tracking do Clint entende traduções especiais de queries:

// Padrões detectados automaticamente:
clint.owner.getName()     → owner_get_name
clint.user.createAccount() → user_create_account
thisOwner.getSomething()  → owner_get_something
owner.doSomething()       → owner_do_something

Variable Mapping

import { ClintVariableTracker } from "graphql-lint-unused-fields-clint";

const tracker = new ClintVariableTracker();

// Analisa atribuições de variáveis
tracker.analyzeVariableAssignments(sourceFile);

// Busca por padrões Clint específicos
const matches = tracker.findClintPatternMatches(["userData"], "getUserInfo", [
  "user_get_data",
  "user_create_profile",
]);

console.log("Matches:", matches);

🚀 Usage

Clint-Specific CLI

npx graphql-lint-clint /path/to/clint

Programmatic

import {
  ClintGraphQLExtractor,
  ClintUsageAnalyzer,
  ClintVariableTracker,
} from "graphql-lint-unused-fields-clint";

// Extract actions from actions.graphql
const extractor = new ClintGraphQLExtractor();
const actions = await extractor.extractClintQueries("/clint/project");

// Analyze usage with variable tracking
const analyzer = new ClintUsageAnalyzer(actionPatterns);
const result = await analyzer.analyzeUsageInPath("/clint/project", true);

console.log(`Actions detected: ${result.totalActions}`);
console.log(`Variable mappings: ${result.variableTracking.totalMappings}`);

🔧 Pattern Converters

import {
  actionToClintPattern,
  clintPatternToAction,
} from "graphql-lint-unused-fields-clint";

// GraphQL Action → Clint Pattern
actionToClintPattern("owner_get_name"); // → 'clint.owner.getName'
actionToClintPattern("user_update_profile"); // → 'clint.user.updateProfile'

// Clint Pattern → GraphQL Action
clintPatternToAction("clint.owner.getName"); // → 'owner_get_name'
clintPatternToAction("clint.payment.processOrder"); // → 'payment_process_order'

📊 Analysis Result

🎯 CLINT ANALYSIS - CUSTOM ACTIONS

📊 STATISTICS:
   🎯 Actions detected: 23
   📋 Clint patterns found: 156
   ✅ Actions in use: 19 (83%)
   ❌ Unused actions: 4 (17%)
   🔍 Variable mappings: 45
   🎯 Clint patterns tracked: 23

❌ UNUSED ACTIONS:

🔹 owner_get_permissions
   • Pattern: clint.owner.getPermissions
   • File: actions.graphql:45

🔹 user_archive_data
   • Pattern: clint.user.archiveData
   • File: actions.graphql:78

🏗️ Architecture

graphql-lint-unused-fields-clint
├── ClintGraphQLExtractor    # Extract actions.graphql
├── ClintUsageAnalyzer      # Analyze clint.* patterns
├── ClintVariableTracker    # Track Clint-specific variables
└── Pattern Converters      # action_name ↔ clint.entity.method

🔗 Core Integration

This package extends graphql-lint-unused-fields with Clint-specific functionality:

import { UnusedFieldsLinter } from "graphql-lint-unused-fields";
import { ClintGraphQLExtractor } from "graphql-lint-unused-fields-clint";

const linter = new UnusedFieldsLinter();
const clintExtractor = new ClintGraphQLExtractor();

// Combine traditional + Clint analysis
const coreQueries = await linter.extractQueries(projectPath);
const clintActions = await clintExtractor.extractClintQueries(projectPath);

const allQueries = [...coreQueries, ...clintActions];

📝 License

MIT