Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests + fix #86

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "turms"
version = "0.8.2"
version = "0.8.3"
description = "graphql-codegen powered by pydantic"
authors = ["jhnnsrs <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/strawberry/test_list_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ def test_list_directive_funcs(directive_schema):

unit_test_with(
generated_ast,
""
"schema = strawberry.Schema(query=Query)",
)
8 changes: 7 additions & 1 deletion tests/schemas/list_field_directive.graphql
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
enum Role {
ADMIN
USER
}


"""
The directive is responsible for authorization check.
"""
Expand All @@ -10,7 +16,7 @@ directive @auth(
"""
The list of roles that an authorized user should have to get the access.
"""
roles: [String!] = []
roles: [Role!] = []
) on FIELD_DEFINITION

type X {
Expand Down
12 changes: 10 additions & 2 deletions turms/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,18 @@ def log(message, level):
)

if project.extensions.turms.dump_schema:
write_schema_to_file(schema, project.extensions.turms.out_dir, project.extensions.turms.schema_name)
write_schema_to_file(
schema,
project.extensions.turms.out_dir,
project.extensions.turms.schema_name,
)

if project.extensions.turms.dump_configuration:
write_project(project, project.extensions.turms.out_dir, project.extensions.turms.configuration_name)
write_project(
project,
project.extensions.turms.out_dir,
project.extensions.turms.configuration_name,
)

except Exception as e:
project_tree.style = "red"
Expand Down
6 changes: 3 additions & 3 deletions turms/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ def validate_importable(cls, v):
raise ValueError(f"Invalid import: {parser.type} {e}") from e

return v


@field_validator("additional_bases")
def validate_additional_bases(cls, v):
Expand All @@ -308,11 +307,12 @@ def validate_additional_bases(cls, v):
raise ValueError("string required")
if value not in dir(builtins):
if "." not in value:
raise ValueError("You need to point to a module if its not a builtin type")
raise ValueError(
"You need to point to a module if its not a builtin type"
)
return v



class Extensions(BaseModel):
"""Wrapping class to be able to extract the tums configuraiton"""

Expand Down
Loading