diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 98b977d..952a599 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.10.1 +current_version = 1.10.2 commit = False tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/nwastdlib/__init__.py b/nwastdlib/__init__.py index 4509678..557e8ba 100644 --- a/nwastdlib/__init__.py +++ b/nwastdlib/__init__.py @@ -13,7 +13,7 @@ # """The NWA-stdlib module.""" -__version__ = "1.10.1" +__version__ = "1.10.2" from nwastdlib.f import const, identity diff --git a/nwastdlib/asyncio.py b/nwastdlib/asyncio.py index 7cda1fd..aba79cf 100644 --- a/nwastdlib/asyncio.py +++ b/nwastdlib/asyncio.py @@ -52,7 +52,7 @@ def make_args(func_args: Iterable | object) -> Iterable: return func_args limiter = CapacityLimiter(limit) - tasks = [to_thread.run_sync(function, *make_args(arg), limiter=limiter) for arg in args] # type: ignore + tasks = [to_thread.run_sync(function, *make_args(arg), limiter=limiter) for arg in args] return await asyncio.gather(*tasks, return_exceptions=return_exceptions) diff --git a/nwastdlib/graphql/extensions/deprecation_checker_extension.py b/nwastdlib/graphql/extensions/deprecation_checker_extension.py index da78277..eacab43 100644 --- a/nwastdlib/graphql/extensions/deprecation_checker_extension.py +++ b/nwastdlib/graphql/extensions/deprecation_checker_extension.py @@ -43,6 +43,16 @@ def get_root_path(path: Path) -> Path: def get_field_deprecation(info: GraphQLResolveInfo) -> str | None: + if not hasattr(info.context, "__field_deprecations_checked__"): + info.context.__field_deprecations_checked__ = set() + + field_tuple = (info.parent_type.name, info.field_name) + if field_tuple in info.context.__field_deprecations_checked__: + # Prevent checking the same field twice, i.e. in lists + return None + + info.context.__field_deprecations_checked__.add(field_tuple) + field = info.parent_type.fields.get(info.field_name) if isinstance(field, GraphQLField): return field.deprecation_reason