MCPcopy Index your code
hub / github.com/maticzav/graphql-shield

github.com/maticzav/graphql-shield @7.6.5 sqlite

repository ↗ · DeepWiki ↗ · release 7.6.5 ↗
231 symbols 418 edges 61 files 27 documented · 12%
README

graphql-shield

CircleCI codecov npm version Backers on Open CollectiveSponsors on Open Collective

GraphQL Server permissions as another layer of abstraction!

Overview

GraphQL Shield helps you create a permission layer for your application. Using an intuitive rule-API, you'll gain the power of the shield engine on every request and reduce the load time of every request with smart caching. This way you can make sure your application will remain quick, and no internal data will be exposed.

Features

  • ✂️ Flexible: Based on GraphQL Middleware.
  • 🤝 Compatible: Works with all GraphQL Servers.
  • 🚀 Smart: Intelligent V8 Shield engine caches all your requests to prevent any unnecessary load.
  • 🎯 Per-Type or Per-Field: Write permissions for your schema, types or specific fields (check the example below).

Documentation

You can find extensive documentation at https://the-guild.dev/graphql/shield.

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

Contributing

We are always looking for people to help us grow graphql-shield! If you have an issue, feature request, or pull request, let us know!

License

MIT @ Matic Zavadlal

Extension points exported contracts — how you extend this code

IRule (Interface)
(no doc) [2 implementers]
packages/graphql-shield/src/types.ts
Context (Interface)
(no doc)
examples/with-graphql-middleware-forward-binding/src/utils.ts
Context (Interface)
(no doc)
examples/advanced/src/utils.ts
ILogicRule (Interface)
(no doc) [2 implementers]
packages/graphql-shield/src/types.ts
IRuleOptions (Interface)
(no doc)
packages/graphql-shield/src/types.ts
IRuleConstructorOptions (Interface)
(no doc)
packages/graphql-shield/src/types.ts
IRuleTypeMap (Interface)
(no doc)
packages/graphql-shield/src/types.ts

Core symbols most depended-on inside this repo

rule
called by 89
packages/graphql-shield/src/constructors.ts
shield
called by 44
packages/graphql-shield/src/shield.ts
and
called by 17
packages/graphql-shield/src/constructors.ts
not
called by 10
packages/graphql-shield/src/constructors.ts
isLogicRule
called by 9
packages/graphql-shield/src/utils.ts
or
called by 9
packages/graphql-shield/src/constructors.ts
withDefault
called by 7
packages/graphql-shield/src/utils.ts
isRule
called by 6
packages/graphql-shield/src/utils.ts

Shape

Interface 121
Method 47
Function 41
Class 22

Languages

TypeScript100%

Modules by API surface

examples/advanced/src/generated/prisma.ts71 symbols
packages/graphql-shield/src/rules.ts53 symbols
examples/with-graphql-middleware-forward-binding/src/generated/prisma.ts45 symbols
packages/graphql-shield/src/types.ts16 symbols
packages/graphql-shield/src/constructors.ts7 symbols
packages/graphql-shield/src/validation.ts6 symbols
packages/graphql-shield/src/utils.ts6 symbols
packages/graphql-shield/src/generator.ts6 symbols
packages/graphql-shield/src/shield.ts2 symbols
examples/with-graphql-nexus/src/lib/helpers/cookies.js2 symbols
examples/advanced/src/utils.ts2 symbols
website/theme.config.tsx1 symbols

Dependencies from manifests, versioned

@babel/core7.19.6 · 1×
@babel/node7.6.3 · 1×
@babel/preset-env7.19.4 · 1×
@babel/preset-typescript7.18.6 · 1×
@changesets/changelog-github0.4.6 · 1×
@changesets/cli2.24.2 · 1×
@graphql-tools/schema8.5.1 · 1×
@graphql-tools/utils8.9.0 · 1×
@theguild/algolia1.0.1 · 1×
@theguild/tailwind-config0.1.3 · 1×
@types/bcryptjs2.4.2 · 1×

For agents

$ claude mcp add graphql-shield \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact