
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@envelop/graphql-middleware
Advanced tools
This plugins wraps [`graphql-middleware`](https://github.com/maticzav/graphql-middleware) and allow you to apply schema middlewares that uses the standard defined by `graphql-middleware`.
@envelop/graphql-middleware
This plugins wraps graphql-middleware
and allow
you to apply schema middlewares that uses the standard defined by graphql-middleware
.
You can find an awesome list of middlewares here
yarn add graphql-middleware @envelop/graphql-middleware
You can use any type of middleware defined for graphql-middleware
, here's an example for doing
that with graphql-shield
:
import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
import { and, not, or, rule, shield } from 'graphql-shield'
import { envelop, useEngine } from '@envelop/core'
import { useGraphQLMiddleware } from '@envelop/graphql-middleware'
// ...
// You can find a complete example here: https://github.com/maticzav/graphql-shield#graphql-yoga
// ...
const permissions = shield({
Query: {
fruits: and(isAuthenticated, or(isAdmin, isEditor))
},
Mutation: {
addFruitToBasket: isAuthenticated
},
Fruit: isAuthenticated,
Customer: isAdmin
})
const getEnveloped = envelop({
plugins: [
useEngine({ parse, validate, specifiedRules, execute, subscribe }),
// ... other plugins ...
useSchema(mySchema),
useGraphQLMiddleware([permissions])
]
})
FAQs
This plugins wraps [`graphql-middleware`](https://github.com/maticzav/graphql-middleware) and allow you to apply schema middlewares that uses the standard defined by `graphql-middleware`.
The npm package @envelop/graphql-middleware receives a total of 0 weekly downloads. As such, @envelop/graphql-middleware popularity was classified as not popular.
We found that @envelop/graphql-middleware demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.