From 1a14acdc0fddb33dc1b1789773fcc39fdd391664 Mon Sep 17 00:00:00 2001 From: Karthikeyan Chinnakonda Date: Thu, 20 Aug 2020 20:34:24 +0530 Subject: [PATCH] minor refactor in remoteField' function --- server/src-lib/Hasura/GraphQL/Schema/Remote.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/src-lib/Hasura/GraphQL/Schema/Remote.hs b/server/src-lib/Hasura/GraphQL/Schema/Remote.hs index 9a430948b78..06a1dfa3d68 100644 --- a/server/src-lib/Hasura/GraphQL/Schema/Remote.hs +++ b/server/src-lib/Hasura/GraphQL/Schema/Remote.hs @@ -83,14 +83,12 @@ remoteField' schemaDoc (G.FieldDefinition description name argsDefinition gType convertType :: G.GType -> m (FieldParser n ()) convertType gType' = do case gType' of - G.TypeNamed (Nullability True) fieldTypeName -> do - remoteFld <- remoteFieldFromName schemaDoc name description fieldTypeName argsDefinition - pure . P.nullableField $ remoteFld + G.TypeNamed (Nullability True) fieldTypeName -> + P.nullableField <$> remoteFieldFromName schemaDoc name description fieldTypeName argsDefinition G.TypeList (Nullability True) gType'' -> addNullableList <$> convertType gType'' G.TypeNamed (Nullability False) fieldTypeName -> do - remoteFld <- remoteFieldFromName schemaDoc name description fieldTypeName argsDefinition - pure . P.nonNullableField $ remoteFld + P.nullableField <$> remoteFieldFromName schemaDoc name description fieldTypeName argsDefinition G.TypeList (Nullability False) gType'' -> addNonNullableList <$> convertType gType'' in convertType gType