From 925c5bd2abf797e02799d76c7c4f2d05e3a61ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Pito=C5=84?= Date: Thu, 18 Apr 2024 12:29:02 +0200 Subject: [PATCH] Commit missing files --- ariadne_graphql_proxy/unwrap_type.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 ariadne_graphql_proxy/unwrap_type.py diff --git a/ariadne_graphql_proxy/unwrap_type.py b/ariadne_graphql_proxy/unwrap_type.py new file mode 100644 index 0000000..d27f7a0 --- /dev/null +++ b/ariadne_graphql_proxy/unwrap_type.py @@ -0,0 +1,14 @@ +from typing import cast + +from graphql import ( + GraphQLType, + GraphQLNamedType, + GraphQLWrappingType, +) + + +def unwrap_graphql_type(type_: GraphQLType) -> GraphQLNamedType: + if isinstance(type_, GraphQLWrappingType): + return unwrap_graphql_type(type_.of_type) + + return cast(GraphQLNamedType, type_)