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

mercurius-auth

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mercurius-auth - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

bench/normal-bench-introspection.js

34

lib/filter-schema.js
'use strict'
const {
wrapSchema,
PruneSchema,
FilterTypes,
TransformObjectFields,
FilterInputObjectFields
} = require('@graphql-tools/wrap')
const { GraphQLObjectType } = require('graphql')
const { pruneSchema } = require('./prune-schema')

@@ -142,26 +135,3 @@ const kDirectiveGrouping = Symbol('mercurius-auth.filtering.group')

return wrapSchema({
schema: graphQLSchema,
transforms: [
new FilterTypes(type => {
// should we filter out this whole type?
return filterDirectiveMap[type.name] !== false
}),
new TransformObjectFields(filterField),
new FilterInputObjectFields(filterField),
new PruneSchema({
skipPruning (type) {
// skip pruning if the type is the Query or Mutation object
return type instanceof GraphQLObjectType && (type.name === 'Query' || type.name === 'Mutation')
}
})
]
})
function filterField (typeName, fieldName, fieldConfig) {
if (filterDirectiveMap[typeName] && filterDirectiveMap[typeName][fieldName] === false) {
return null // omit the field
}
return undefined // unchanged
}
return pruneSchema(graphQLSchema, filterDirectiveMap)
}
{
"name": "mercurius-auth",
"version": "2.0.1",
"version": "2.0.2",
"description": "Mercurius Auth Plugin adds configurable Authentication and Authorization support to Mercurius.",

@@ -51,4 +51,3 @@ "main": "index.js",

"dependencies": {
"@fastify/error": "^2.0.0",
"@graphql-tools/wrap": "8.4.12",
"@fastify/error": "^3.0.0",
"fastify-plugin": "^3.0.0",

@@ -55,0 +54,0 @@ "graphql": "^16.2.0"

@@ -237,2 +237,24 @@ # mercurius-auth

### Normal GraphQL Server Mode | With Introspection Filters
Last run: `2022-05-24`
```text
┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬────────┐
│ Stat │ 2.5% │ 50% │ 97.5% │ 99% │ Avg │ Stdev │ Max │
├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼────────┤
│ Latency │ 10 ms │ 12 ms │ 30 ms │ 47 ms │ 13.59 ms │ 6.54 ms │ 155 ms │
└─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴────────┘
┌───────────┬─────────┬─────────┬────────┬─────────┬─────────┬─────────┬─────────┐
│ Stat │ 1% │ 2.5% │ 50% │ 97.5% │ Avg │ Stdev │ Min │
├───────────┼─────────┼─────────┼────────┼─────────┼─────────┼─────────┼─────────┤
│ Req/Sec │ 2559 │ 2559 │ 7607 │ 8335 │ 7101.55 │ 1579.83 │ 2559 │
├───────────┼─────────┼─────────┼────────┼─────────┼─────────┼─────────┼─────────┤
│ Bytes/Sec │ 1.04 MB │ 1.04 MB │ 3.1 MB │ 3.39 MB │ 2.89 MB │ 643 kB │ 1.04 MB │
└───────────┴─────────┴─────────┴────────┴─────────┴─────────┴─────────┴─────────┘
Req/Bytes counts sampled once per second.
78k requests in 11.05s, 31.8 MB read
```
### Gateway GraphQL Server Mode | Without Auth

@@ -239,0 +261,0 @@

Sorry, the diff of this file is not supported yet

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