Skip to content

Commit a87bb5f

Browse files
ImTotemclaude
andcommitted
fix(lint): override process_errors as method, not constructor param
Pyright reports process_errors is not a Schema constructor parameter. Subclass strawberry.Schema and override the method instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4f53de3 commit a87bb5f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/bcsd_api/graphql/schema.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ class Mutation:
5656
logger = logging.getLogger("strawberry.execution")
5757

5858

59-
def _process_errors(errors: List[GraphQLError], ctx: ExecutionContext | None = None) -> None:
60-
for err in errors:
61-
if isinstance(err.original_error, AppException):
62-
continue
63-
logger.error(err.message, exc_info=err.original_error)
59+
class _Schema(strawberry.Schema):
60+
def process_errors(self, errors: List[GraphQLError], ctx: ExecutionContext | None = None) -> None:
61+
for err in errors:
62+
if isinstance(err.original_error, AppException):
63+
continue
64+
logger.error(err.message, exc_info=err.original_error)
6465

6566

66-
schema = strawberry.Schema(
67+
schema = _Schema(
6768
query=Query,
6869
mutation=Mutation,
6970
extensions=[AppErrorExtension],
70-
process_errors=_process_errors,
7171
)

0 commit comments

Comments
 (0)