From e0ea004e8081eab00171402fd989fa20f442dc3e Mon Sep 17 00:00:00 2001 From: Inex Code Date: Wed, 12 Apr 2023 16:13:30 +0300 Subject: [PATCH] feat: Test if getting headers works --- selfprivacy_api/graphql/schema.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/selfprivacy_api/graphql/schema.py b/selfprivacy_api/graphql/schema.py index dff9304..d65143f 100644 --- a/selfprivacy_api/graphql/schema.py +++ b/selfprivacy_api/graphql/schema.py @@ -4,6 +4,8 @@ import asyncio from typing import AsyncGenerator import strawberry +from strawberry.types import Info + from selfprivacy_api.graphql import IsAuthenticated from selfprivacy_api.graphql.mutations.api_mutations import ApiMutations from selfprivacy_api.graphql.mutations.job_mutations import JobMutations @@ -58,6 +60,11 @@ class Query: """Services queries""" return Services() + @strawberry.field() + def test(self, info: Info) -> str: + """Test query""" + return info.context["request"].headers["Accept-Language"] + @strawberry.type class Mutation(