We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1441084 commit 60b001dCopy full SHA for 60b001d
api/schema/collaborative_schema.py
@@ -197,6 +197,18 @@ def contributors_by_collaborative(
197
f"Collaborative with ID {collaborative_id} does not exist."
198
)
199
200
+ @strawberry_django.field
201
+ @trace_resolver(
202
+ name="get_collaborative_by_slug",
203
+ attributes={"component": "collaborative"},
204
+ )
205
+ def collaborative_by_slug(self, info: Info, slug: str) -> TypeCollaborative:
206
+ try:
207
+ collaborative = Collaborative.objects.get(slug=slug)
208
+ return TypeCollaborative.from_django(collaborative)
209
+ except Collaborative.DoesNotExist:
210
+ raise ValueError(f"Collaborative with slug {slug} does not exist.")
211
+
212
213
@trace_resolver(
214
name="update_collaborative_tags", attributes={"component": "collaborative"}
0 commit comments