Skip to content

Commit 2325e45

Browse files
committed
Rename plugin to ClientForwardRefsPlugin
1 parent 777b3a5 commit 2325e45

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+38
-38
lines changed

Diff for: CHANGELOG.md

+1-1

Diff for: README.md

+1-1

Diff for: ariadne_codegen/contrib/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
from .client_forward_refs import ClientForwardRefsPlugin
12
from .extract_operations import ExtractOperationsPlugin
2-
from .no_global_imports import NoGlobalImportsPlugin
33
from .no_reimports import NoReimportsPlugin
44
from .shorter_results import ShorterResultsPlugin
55

66
__all__ = [
77
"ExtractOperationsPlugin",
88
"NoReimportsPlugin",
99
"ShorterResultsPlugin",
10-
"NoGlobalImportsPlugin",
10+
"ClientForwardRefsPlugin",
1111
]

Diff for: ariadne_codegen/contrib/no_global_imports.py renamed to ariadne_codegen/contrib/client_forward_refs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
TYPE_CHECKING_FLAG: str = "TYPE_CHECKING"
2020

2121

22-
class NoGlobalImportsPlugin(Plugin):
22+
class ClientForwardRefsPlugin(Plugin):
2323
"""Only import types when you call an endpoint needing it"""
2424

2525
def __init__(self, schema: GraphQLSchema, config_dict: Dict) -> None:

Diff for: tests/main/clients/no_global_imports/expected_client/__init__.py renamed to tests/main/clients/client_forward_refs/expected_client/__init__.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
from .async_base_client import AsyncBaseClient
22
from .base_model import BaseModel, Upload
33
from .client import Client
4+
from .client_forward_refs_fragments import (
5+
FragmentWithSingleField,
6+
FragmentWithSingleFieldQueryUnwrapFragment,
7+
ListAnimalsFragment,
8+
ListAnimalsFragmentListAnimals,
9+
)
410
from .exceptions import (
511
GraphQLClientError,
612
GraphQLClientGraphQLError,
@@ -29,12 +35,6 @@
2935
from .list_strings_3 import ListStrings3
3036
from .list_strings_4 import ListStrings4
3137
from .list_type_a import ListTypeA, ListTypeAListOptionalTypeA
32-
from .no_global_imports_fragments import (
33-
FragmentWithSingleField,
34-
FragmentWithSingleFieldQueryUnwrapFragment,
35-
ListAnimalsFragment,
36-
ListAnimalsFragmentListAnimals,
37-
)
3838
from .subscribe_strings import SubscribeStrings
3939
from .unwrap_fragment import UnwrapFragment
4040

Diff for: tests/main/clients/no_global_imports/expected_client/get_animal_fragment_with_extra.py renamed to tests/main/clients/client_forward_refs/expected_client/get_animal_fragment_with_extra.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from pydantic import Field
44

5-
from .no_global_imports_fragments import ListAnimalsFragment
5+
from .client_forward_refs_fragments import ListAnimalsFragment
66

77

88
class GetAnimalFragmentWithExtra(ListAnimalsFragment):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from .client_forward_refs_fragments import FragmentWithSingleField
2+
3+
4+
class UnwrapFragment(FragmentWithSingleField):
5+
pass

Diff for: tests/main/clients/no_global_imports/pyproject.toml renamed to tests/main/clients/client_forward_refs/pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
schema_path = "schema.graphql"
33
queries_path = "queries.graphql"
44
include_comments = "none"
5-
target_package_name = "no_global_imports"
5+
target_package_name = "client_forward_refs"
66
files_to_include = ["custom_scalars.py"]
7-
fragments_module_name = "no_global_imports_fragments"
8-
plugins = ["ariadne_codegen.contrib.no_global_imports.NoGlobalImportsPlugin"]
7+
fragments_module_name = "client_forward_refs_fragments"
8+
plugins = ["ariadne_codegen.contrib.client_forward_refs.ClientForwardRefsPlugin"]
99

1010
[tool.ariadne-codegen.scalars.SimpleScalar]
1111
type = ".custom_scalars.SimpleScalar"

Diff for: tests/main/clients/no_global_imports_shorter_results/expected_client/__init__.py renamed to tests/main/clients/client_forward_refs_shorter_results/expected_client/__init__.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
from .async_base_client import AsyncBaseClient
22
from .base_model import BaseModel, Upload
33
from .client import Client
4+
from .client_forward_refs_shorter_resultsfragments import (
5+
FragmentWithSingleField,
6+
FragmentWithSingleFieldQueryUnwrapFragment,
7+
ListAnimalsFragment,
8+
ListAnimalsFragmentListAnimals,
9+
)
410
from .exceptions import (
511
GraphQLClientError,
612
GraphQLClientGraphQLError,
@@ -29,12 +35,6 @@
2935
from .list_strings_3 import ListStrings3
3036
from .list_strings_4 import ListStrings4
3137
from .list_type_a import ListTypeA, ListTypeAListOptionalTypeA
32-
from .no_global_imports_shorter_resultsfragments import (
33-
FragmentWithSingleField,
34-
FragmentWithSingleFieldQueryUnwrapFragment,
35-
ListAnimalsFragment,
36-
ListAnimalsFragmentListAnimals,
37-
)
3838
from .subscribe_strings import SubscribeStrings
3939
from .unwrap_fragment import UnwrapFragment
4040

Diff for: tests/main/clients/no_global_imports_shorter_results/expected_client/client.py renamed to tests/main/clients/client_forward_refs_shorter_results/expected_client/client.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
from .async_base_client import AsyncBaseClient
44

55
if TYPE_CHECKING:
6+
from .client_forward_refs_shorter_resultsfragments import (
7+
FragmentWithSingleFieldQueryUnwrapFragment,
8+
)
69
from .custom_scalars import ComplexScalar, SimpleScalar
710
from .get_animal_by_name import (
811
GetAnimalByNameAnimalByNameAnimal,
@@ -17,9 +20,6 @@
1720
ListAnimalsListAnimalsDog,
1821
)
1922
from .list_type_a import ListTypeAListOptionalTypeA
20-
from .no_global_imports_shorter_resultsfragments import (
21-
FragmentWithSingleFieldQueryUnwrapFragment,
22-
)
2323

2424

2525
def gql(q: str) -> str:

Diff for: tests/main/clients/no_global_imports_shorter_results/expected_client/get_animal_fragment_with_extra.py renamed to tests/main/clients/client_forward_refs_shorter_results/expected_client/get_animal_fragment_with_extra.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from pydantic import Field
44

5-
from .no_global_imports_shorter_resultsfragments import ListAnimalsFragment
5+
from .client_forward_refs_shorter_resultsfragments import ListAnimalsFragment
66

77

88
class GetAnimalFragmentWithExtra(ListAnimalsFragment):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from .client_forward_refs_shorter_resultsfragments import FragmentWithSingleField
2+
3+
4+
class UnwrapFragment(FragmentWithSingleField):
5+
pass

Diff for: tests/main/clients/no_global_imports_shorter_results/pyproject.toml renamed to tests/main/clients/client_forward_refs_shorter_results/pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
schema_path = "schema.graphql"
33
queries_path = "queries.graphql"
44
include_comments = "none"
5-
target_package_name = "no_global_imports_shorter_results"
5+
target_package_name = "client_forward_refs_shorter_results"
66
files_to_include = ["custom_scalars.py"]
7-
fragments_module_name = "no_global_imports_shorter_resultsfragments"
7+
fragments_module_name = "client_forward_refs_shorter_resultsfragments"
88
plugins = [
99
"ariadne_codegen.contrib.shorter_results.ShorterResultsPlugin",
10-
"ariadne_codegen.contrib.no_global_imports.NoGlobalImportsPlugin"
10+
"ariadne_codegen.contrib.client_forward_refs.ClientForwardRefsPlugin"
1111
]
1212

1313
[tool.ariadne-codegen.scalars.SimpleScalar]

Diff for: tests/main/clients/no_global_imports/expected_client/unwrap_fragment.py

-5
This file was deleted.

Diff for: tests/main/clients/no_global_imports_shorter_results/expected_client/unwrap_fragment.py

-5
This file was deleted.

0 commit comments

Comments
 (0)