Skip to content

v1.0.0 - Major Feature Release

Latest

Choose a tag to compare

@omar-dulaimi omar-dulaimi released this 22 Aug 15:10

πŸŽ‰ GraphQL Shield Generator v1.0.0

This is a major stable release with powerful new features and improvements!

✨ New Features

πŸ” Custom Authentication Rules

  • Replace default allow with your custom authentication rules
  • Smart imports - only imports what's actually used
  • customrule and customrulepath options

πŸ›‘οΈ Security-First Fallback Rules

  • fallbackRule: 'deny' - Adds '*': deny for secure by default
  • fallbackRule: 'allow' - Adds '*': allow for permissive approach
  • fallbackRule: false - Clean output with no fallback rules

πŸ“Š Smart Type Ordering

  • groupbyobjects: true - Orders types by priority (Query β†’ Mutation β†’ Subscription β†’ Others)
  • Much more logical than the previous broken implementation

βš™οΈ Shield Constructor Options

  • shieldoptions - Pass custom options directly to GraphQL Shield
  • Example: '{ allowExternalErrors: true }'

πŸ”§ Critical Fixes

  • βœ… Fixed missing deny import when using fallback rules
  • βœ… Fixed import formatting with proper newlines
  • βœ… Replaced broken groupbyobjects logic with meaningful type ordering
  • βœ… Smart conditional imports (only imports what's needed)

πŸš€ Infrastructure Improvements

  • βœ… Updated all dependencies to latest versions
  • βœ… Comprehensive example directory with 8+ test scenarios
  • βœ… Modern, professional README with real examples
  • βœ… GitHub Sponsors integration
  • βœ… Perfect TypeScript support
  • βœ… Both ES modules and CommonJS support

πŸ“– Usage Examples

// Security-first approach
await generateGraphqlShield({
  schema: { typeDefs, resolvers },
  options: {
    customrule: 'hasAuth',
    customrulepath: './auth/hasAuth',
    fallbackRule: 'deny', // Secure by default
    groupbyobjects: true, // Organized output
    shieldoptions: '{ allowExternalErrors: true }',
  },
});

πŸ’₯ Breaking Changes

  • groupbyobjects behavior changed from broken reverse logic to meaningful type priority ordering
  • Import behavior is now smarter and conditional

πŸ”— Links

Installation:

npm install [email protected]

⭐ If this release helped you, please consider starring the repo and sponsoring the project!