
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
graphql-utilities tries to secure your GraphQL API from malicious queries and provides utilities to make using graphql-core
easier.
It comes with a custom configurable ExtendedExecutionContext
class that is capable of performing:
@cost()
directive provided, graphql-utilities
provides helper functions and custom execution context to protect you from overly complex queries.It also ships decorators for:
graphql-core
is run at field-level, it is handly when you need your middleware to run only once, especially auth-related middleware.pip install graphql-utilities
Alternatively, if you use pipenv:
pipenv install graphql-utilities
from graphql_utilities.decorators import run_only_once
class AuthMiddleware:
@run_only_once
def resolve(self, next_, root, info, *args, **kwargs):
# middleware logic
return next_(root, info, *args, **kwargs)
# import your schema
from graphql import execute, parse # Requires `graphql-core>=3.0`
from graphql_utilities.execution import ExtendedExecutionContext
query = '{ field_1_str field_2_int field_3_obj { field_3_obj_sub_1 { xxx } } }'
graphql_sync(schema=schema, source=query,
context_value={"depth_analysis": {
"max_depth": 2 # Maximum depth allowed
}},
execution_context_class=ExtendedExecutionContext # Use the `ExtendedExecutionContext` provided in `graphql-utilities`
)
See the documentation at https://graphql-utilities.readthedocs.io/en/latest/
In recent projects, I ran into some problems with graphene
and graphql-core
including missing operation-level middleware (See issue here), etc.
graphql-utilities
is a compilation of utilities and custom execution context for depth analysis, etc targeting graphql-core>=3.0
.
Any form of contribution, feature requests, bug reports, pull requests are largely welcome.
MIT Licensed. GraphQL logo is licensed under Facebook BSD.
FAQs
Collection of utilities, middleware, decorators for graphql-core>=3.0
We found that graphql-utilities demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.