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

Restructure modules and add documentation #3546

Merged
merged 86 commits into from
Jul 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
a532599
Use standard code blocks instead of `>>>` codeblocks
patrick91 Jun 10, 2024
2b774eb
Test with PEP 727
patrick91 Jun 10, 2024
ebcf7be
Rename type module to strawberry_type
patrick91 Jun 13, 2024
6855262
Add docs for strawberry.type/input/interface
patrick91 Jun 13, 2024
cb78124
Lazy type docs
patrick91 Jun 14, 2024
08b9ae9
Initial doc for the schema
patrick91 Jun 14, 2024
2526640
Initial docs for schema
patrick91 Jun 14, 2024
3e93f4e
Markdown
patrick91 Jun 14, 2024
c4b366a
Move example in class' docstring
patrick91 Jun 14, 2024
cf2f4a6
Docs for strawberry.argument
patrick91 Jun 16, 2024
6b03359
Docs for directives
patrick91 Jun 16, 2024
d03e696
Document enums
patrick91 Jun 17, 2024
79d0461
Test
patrick91 Jun 17, 2024
b9c5792
Document field, mutation and subscription
patrick91 Jun 17, 2024
ea6ad0d
Fix
patrick91 Jun 17, 2024
dde29e6
Document BasePermission
patrick91 Jun 17, 2024
41f63b2
Document info
patrick91 Jun 17, 2024
e8ce787
Fix typo
patrick91 Jun 17, 2024
a2cadb1
Test
patrick91 Jun 18, 2024
d7f01ae
Module docstring
patrick91 Jun 18, 2024
ade2f22
Use proper code block
patrick91 Jun 18, 2024
1ea3ae5
Move auto to types module
patrick91 Jun 22, 2024
d0495b8
Move enum to types module
patrick91 Jun 22, 2024
88af9b1
Update doc for Private
patrick91 Jun 23, 2024
d7a54a5
Move private to types module
patrick91 Jun 23, 2024
4ea8f98
Move union to types module
patrick91 Jun 23, 2024
06c2a7e
Move lazy_type to types module
patrick91 Jun 23, 2024
4fa56c0
Move unset to types module
patrick91 Jun 23, 2024
8aa828f
Move custom scalar to types module as just scalar
patrick91 Jun 23, 2024
1672b30
Test google style strings
patrick91 Jun 23, 2024
213dcfa
Fix typo
patrick91 Jun 23, 2024
7951513
Test
patrick91 Jun 23, 2024
2cf82d2
Fix case
patrick91 Jun 23, 2024
7177fa5
Revert "Test"
patrick91 Jun 23, 2024
dcd55ed
Initial conversion to google docs style
patrick91 Jun 23, 2024
f765e61
Use google docstrings
patrick91 Jun 23, 2024
0562d82
Add docs for auto
patrick91 Jun 29, 2024
eeb1175
ID doc
patrick91 Jun 29, 2024
cf39d70
Fix some typos
patrick91 Jun 29, 2024
8f33339
Fix typo
patrick91 Jun 29, 2024
97ae521
Test
patrick91 Jun 29, 2024
72afab9
T
patrick91 Jun 29, 2024
d4493ad
Unset
patrick91 Jun 29, 2024
2006f1b
Add __all__ in aiohttp
patrick91 Jun 30, 2024
4e4a890
s/python3/python
patrick91 Jun 30, 2024
abb8798
More all
patrick91 Jun 30, 2024
c248eeb
Query depth
patrick91 Jun 30, 2024
4329d3a
Various changes for doc
patrick91 Jun 30, 2024
53d2cae
Last >>>
patrick91 Jul 1, 2024
0b22a29
Ruff google style
patrick91 Jul 1, 2024
3ac49d6
Parameters to args
patrick91 Jul 1, 2024
48137bc
Move object types to types
patrick91 Jul 1, 2024
e953212
WIP
patrick91 Jul 1, 2024
a9d87bb
Fix
patrick91 Jul 1, 2024
40be586
Field -> types + codemod
patrick91 Jul 5, 2024
e800b55
Same for mutation
patrick91 Jul 5, 2024
9b2ba50
Update snaps
patrick91 Jul 5, 2024
7e4f1de
Argument
patrick91 Jul 5, 2024
5112137
More renames
patrick91 Jul 5, 2024
5176bf6
Raise error if unable to parse JSON
patrick91 Jul 5, 2024
be5baff
Fix?
patrick91 Jul 5, 2024
33db1aa
Some type fixes
patrick91 Jul 5, 2024
5a15a4e
Update test
patrick91 Jul 5, 2024
1333169
__all__ (almost) everywhere
patrick91 Jul 6, 2024
bb66a76
Apply suggestions from code review
patrick91 Jul 15, 2024
4bc4ba2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 15, 2024
6a8177b
Add test
patrick91 Jul 15, 2024
17bb9c4
types.types to types.base
patrick91 Jul 15, 2024
392778c
Update codemod
patrick91 Jul 15, 2024
2f2dc6b
Apply suggestions from code review
patrick91 Jul 15, 2024
239a98e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 15, 2024
0a305fc
Apply suggestions from code review
patrick91 Jul 15, 2024
bfd4010
Apply suggestions from code review
patrick91 Jul 16, 2024
0632502
Apply suggestions from code review
patrick91 Jul 16, 2024
e554bd8
Update codemod
patrick91 Jul 16, 2024
8e1fe7d
Fix codemod and add more changes
patrick91 Jul 16, 2024
569ecdf
Add release file
patrick91 Jul 17, 2024
af44f06
Update TWEET.md
patrick91 Jul 17, 2024
5aaace6
Check for libcst
patrick91 Jul 17, 2024
a5cfb54
Some mypy fixes
patrick91 Jul 17, 2024
9ef4fe7
Shorter tweet
patrick91 Jul 17, 2024
d2b0bed
Happy mypy?
patrick91 Jul 17, 2024
67c18d8
Ignore some errors for now
patrick91 Jul 17, 2024
7d0f6c1
Pyright update change
patrick91 Jul 17, 2024
e7880aa
Merge branch 'main' into feature/docstring
patrick91 Jul 17, 2024
846c0f8
Add breaking changes file
patrick91 Jul 17, 2024
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
Prev Previous commit
Add breaking changes file
patrick91 committed Jul 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 846c0f868f6442b4234cc6aa1da7c71630b4bef1
1 change: 1 addition & 0 deletions docs/breaking-changes.mdx
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ title: List of breaking changes and deprecations

# List of breaking changes and deprecations

- [Version 0.236.0 - 17 July 2024](./breaking-changes/0.236.0.md)
- [Version 0.233.0 - 29 May 2024](./breaking-changes/0.233.0.md)
- [Version 0.217.0 - 18 December 2023](./breaking-changes/0.217.0.md)
- [Version 0.213.0 - 8 November 2023](./breaking-changes/0.213.0.md)
19 changes: 19 additions & 0 deletions docs/breaking-changes/0.236.0.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: 0.236.0 Breaking Changes
slug: breaking-changes/0.236.0
---

# v0.236.0 changes some of the imports

This release changes the location of some files in the codebase, this is to make
the codebase more organized and easier to navigate.

Technically most of these changes should not affect you, but if you were
importing some of the files directly you will need to update the imports.

We created a codemod to help you with that, feel free to try and submit bugs if
we missed something.

```bash
strawberry upgrade update-imports
```

Unchanged files with check annotations Beta

return response
__all__ = ["GraphQLTestClient"]

Check warning on line 53 in strawberry/aiohttp/test/client.py

Codecov / codecov/patch

strawberry/aiohttp/test/client.py#L53

Added line #L53 was not covered by tests
try:
major, minor, patch = map(int, package_version_str.split("."))
except ValueError:
major, minor, patch = (0, 0, 0)

Check warning on line 28 in strawberry/cli/commands/upgrade/_run_codemod.py

Codecov / codecov/patch

strawberry/cli/commands/upgrade/_run_codemod.py#L27-L28

Added lines #L27 - L28 were not covered by tests
return major, minor, patch
additional_kwargs: Dict[str, Any] = {}
if _get_libcst_version() >= (1, 4, 0):
additional_kwargs["scratch"] = {}

Check warning on line 39 in strawberry/cli/commands/upgrade/_run_codemod.py

Codecov / codecov/patch

strawberry/cli/commands/upgrade/_run_codemod.py#L39

Added line #L39 was not covered by tests
# TODO: maybe capture warnings?
with open(os.devnull, "w") as null: # noqa: PTH123
return super().__getitem__(key)
__all__ = ["StrawberrySanicContext"]

Check warning on line 27 in strawberry/sanic/context.py

Codecov / codecov/patch

strawberry/sanic/context.py#L27

Added line #L27 was not covered by tests
@property
def type_params(self) -> List[TypeVar]:
return []

Check warning on line 48 in strawberry/types/base.py

Codecov / codecov/patch

strawberry/types/base.py#L48

Added line #L48 was not covered by tests
@property
def is_one_of(self) -> bool:
return self is other
elif isinstance(other, StrawberryAnnotation):
return self == other.resolve()

Check warning on line 78 in strawberry/types/base.py

Codecov / codecov/patch

strawberry/types/base.py#L78

Added line #L78 was not covered by tests
else:
# This could be simplified if StrawberryAnnotation.resolve() always returned
def __hash__(self) -> int:
# TODO: Is this a bad idea? __eq__ objects are supposed to have the same hash
return id(self)

Check warning on line 91 in strawberry/types/base.py

Codecov / codecov/patch

strawberry/types/base.py#L91

Added line #L91 was not covered by tests
class StrawberryContainer(StrawberryType):
column=mypy_result["column"] + 1,
)
)
except json.JSONDecodeError:
raise Exception(f"Invalid JSON: {full_output}")

Check warning on line 80 in tests/typecheckers/utils/mypy.py

Codecov / codecov/patch

tests/typecheckers/utils/mypy.py#L79-L80

Added lines #L79 - L80 were not covered by tests
results.sort(key=lambda x: (x.line, x.column, x.message))