|
14 | 14 | {-# LANGUAGE UndecidableInstances #-} -- for TypeError
|
15 | 15 |
|
16 | 16 | module GraphQL.Resolver
|
17 |
| - ( ResolverError(..) -- XXX: Exporting constructor for tests. Not sure if that's what we really want. |
| 17 | + ( ResolverError(..) |
18 | 18 | , HasResolver(..)
|
19 | 19 | , (:<>)(..)
|
20 | 20 | , Defaultable(..)
|
@@ -217,24 +217,11 @@ instance forall m ksN enum. (Applicative m, API.GraphQLEnum enum) => HasResolver
|
217 | 217 | type Handler m (API.Enum ksN enum) = enum
|
218 | 218 | resolve handler _ = (pure . ok . GValue.ValueEnum . API.enumToValue) handler
|
219 | 219 |
|
220 |
| - |
221 |
| --- TODO: variables should error, they should have been resolved already. |
222 |
| --- |
223 |
| --- TODO: Objects. Maybe implement some Generic object reader? I.e. if I do |
224 |
| --- data Greet = Greet { name :: Text, score :: Int } deriving Generic |
225 |
| --- then "instance ReadValue Greet" would fall back on a default reader that |
226 |
| --- expects Objects? |
227 |
| --- Maybe we can use advanced fallbacks like these: |
228 |
| --- https://wiki.haskell.org/GHC/AdvancedOverlap |
229 |
| - |
230 |
| - |
231 |
| --- Iterate through handlers (zipped together with their type |
232 |
| --- definition) and execute handler if the name matches. |
233 |
| - |
234 |
| --- TODO: A parametrized `Result` is really not a good way to handle |
235 |
| --- the "result" for resolveField, but not sure what to use either. I |
236 |
| --- liked the tuple we had before more because it didn't imply any |
237 |
| --- other structure or meaning. Maybe we can jsut create a new datatype. |
| 220 | +-- TODO: A parametrized `Result` is really not a good way to handle the |
| 221 | +-- "result" for resolveField, but not sure what to use either. Tom liked the |
| 222 | +-- tuple we had before more because it didn't imply any other structure or |
| 223 | +-- meaning. Maybe we can just create a new datatype. jml thinks we should |
| 224 | +-- extract some helpful generic monad, ala `Validator`. |
238 | 225 | type ResolveFieldResult = Result (Maybe GValue.ObjectField)
|
239 | 226 |
|
240 | 227 | -- Extract field name from an argument type. TODO: ideally we'd run
|
|
0 commit comments