strawberry-graphql 0.246.2__py3-none-any.whl → 0.246.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
strawberry/permission.py CHANGED
@@ -156,11 +156,19 @@ class PermissionExtension(FieldExtension):
156
156
  self.use_directives = use_directives
157
157
 
158
158
  def apply(self, field: StrawberryField) -> None:
159
- """Applies all of the permission directives to the schema and sets up silent permissions."""
159
+ """Applies all of the permission directives (deduped) to the schema and sets up silent permissions."""
160
160
  if self.use_directives:
161
- field.directives.extend(
162
- p.schema_directive for p in self.permissions if p.schema_directive
163
- )
161
+ permission_directives = [
162
+ perm.schema_directive
163
+ for perm in self.permissions
164
+ if perm.schema_directive
165
+ ]
166
+ # Iteration, because we want to keep order
167
+ for perm_directive in permission_directives:
168
+ # Dedupe multiple directives
169
+ if perm_directive in field.directives:
170
+ continue
171
+ field.directives.append(perm_directive)
164
172
  # We can only fail silently if the field is optional or a list
165
173
  if self.fail_silently:
166
174
  if isinstance(field.type, StrawberryOptional):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: strawberry-graphql
3
- Version: 0.246.2
3
+ Version: 0.246.3
4
4
  Summary: A library for creating GraphQL APIs
5
5
  Home-page: https://strawberry.rocks/
6
6
  License: MIT
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.9
17
17
  Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
20
21
  Classifier: Topic :: Software Development :: Libraries
21
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
23
  Provides-Extra: aiohttp
@@ -144,7 +144,7 @@ strawberry/http/typevars.py,sha256=8hK5PfNPZXb2EhZmqlobYyfwJJcO2Wb96T91MlLEVJs,4
144
144
  strawberry/litestar/__init__.py,sha256=zsXzg-mglCGUVO9iNXLm-yadoDSCK7k-zuyRqyvAh1w,237
145
145
  strawberry/litestar/controller.py,sha256=oKjio86UsFjvdwxx80YqX_-WWnw51Sd7saMulQ0ihIQ,13519
146
146
  strawberry/parent.py,sha256=sXURm0lauSpjUADsmfNGY-Zl7kHs0A67BFcWuWKzRxw,771
147
- strawberry/permission.py,sha256=NsYq-c4AgDCDBsYXsJN94yWJjuwYkvytpqXE4BIf_vc,7226
147
+ strawberry/permission.py,sha256=HusiB46yZANdpZM3AdzFVZB6JkCu7dcvoZ3QP2E01jM,7575
148
148
  strawberry/printer/__init__.py,sha256=DmepjmgtkdF5RxK_7yC6qUyRWn56U-9qeZMbkztYB9w,62
149
149
  strawberry/printer/ast_from_value.py,sha256=LgM5g2qvBOnAIf9znbiMEcRX0PGSQohR3Vr3QYfU604,4983
150
150
  strawberry/printer/printer.py,sha256=GntTBivg3fb_zPM41Q8DtWMiRmkmM9xwTF-aFWvnqTg,17524
@@ -230,8 +230,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
230
230
  strawberry/utils/operation.py,sha256=SSXxN-vMqdHO6W2OZtip-1z7y4_A-eTVFdhDvhKeLCk,1193
231
231
  strawberry/utils/str_converters.py,sha256=KGd7QH90RevaJjH6SQEkiVVsb8KuhJr_wv5AsI7UzQk,897
232
232
  strawberry/utils/typing.py,sha256=3xws5kxSQGsp8BnYyUwClvxXNzZakMAuOPoq1rjHRuk,14252
233
- strawberry_graphql-0.246.2.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
234
- strawberry_graphql-0.246.2.dist-info/METADATA,sha256=QvWWIL7QAi2coSdJLZKJtHnkHdlSSeXTyin6F0szKNU,7707
235
- strawberry_graphql-0.246.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
236
- strawberry_graphql-0.246.2.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
237
- strawberry_graphql-0.246.2.dist-info/RECORD,,
233
+ strawberry_graphql-0.246.3.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
234
+ strawberry_graphql-0.246.3.dist-info/METADATA,sha256=Q7vLEXz9pa7Nxmw2LwvWhS6Zw6K6BGlkOtyj979K154,7758
235
+ strawberry_graphql-0.246.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
236
+ strawberry_graphql-0.246.3.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
237
+ strawberry_graphql-0.246.3.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: poetry-core 1.9.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any