Project

General

Profile

Actions

Bug #662

open

List resolvers

Added by Dmitrii Skurikhin 23 days ago. Updated 23 days ago.

Status:
New
Priority:
Normal
Category:
-
Target version:
-
% Done:

0%


Description

queryType :: ObjectType
queryType = Out.ObjectType "Query" Nothing [] $ HashMap.fromList [ ("listField", Out.ValueResolver listField listResolver) ]
listField = Out.Field Nothing (Out.ListType $ Out.NonNullObjectType listType) HashMap.empty
item1 = Type.Object $ HashMap.fromList [ ("id", "1") ]
item2 = Type.Object $ HashMap.fromList [ ("id", "2") ]
listResolver = pure $ Type.List [ item1, item2 ]

listType :: ObjectType
listType = Out.ObjectType "ListItem" Nothing [] $ HashMap.fromList [ ("id", Out.ValueResolver stringField (pure $ Type.String "3")) ]

execute ...args -> [{id: '3'}, {id: '3}] - resolver results will be ignored. But if the result of listResolver is an empty list, execute ...args -> []

Actions #1

Updated by Dmitrii Skurikhin 23 days ago

  • Description updated (diff)
Actions #2

Updated by Dmitrii Skurikhin 23 days ago

  • Description updated (diff)
Actions

Also available in: Atom PDF