Skip to content

Commit

Permalink
Fix error, add problems to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalp committed Oct 5, 2024
1 parent 752d2b8 commit 3c0bbef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,16 @@
An example GraphQL API implemented with Ariadne GraphQL Modules v2.

This API aims to use ALL features from GraphQL Modules v2. It can also be used as a reference for other developers.


# Problems found

## `list[SchemaType]` type in `make_executable_schema`

`list` is [invariant in mypy](https://mypy.readthedocs.io/en/stable/common_issues.html#variance). A list of `type[GraphQLObject]`, like one from the `example.queries.__init__` produces an error because `list[type[GraphQLObject]]` is incompatible with `list[type[GraphQLType]]`.


## Resolvers need to be `@classmethod` or `@staticmethod` to keep linters happy.

Linters will scream that resolver method decorated with `@ObectType.resolver` is missing `self` first attribute.

4 changes: 3 additions & 1 deletion example/queries/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from typing import Any

from . import groups, hello, users

queries = [
queries: Any = [
groups.Query,
hello.Query,
users.Query,
Expand Down

0 comments on commit 3c0bbef

Please sign in to comment.