forked from OSS/graphql
Deprecate enum, enumA, wrappedEnum, wrappedEnumA
These functions are from Language.GraphQL.Schema. There are actually only two generic types in GraphQL: Scalars and objects. Enum is a scalar value. According to the specification enums may be serailized to strings. And in the current implementation they used untyped strings anyway, so there is no point to have differently named functions with the same implementation as their scalar counterparts.
This commit is contained in:
@ -26,6 +26,7 @@ import Control.Monad.Trans.Except (throwE)
|
||||
import Data.Maybe (catMaybes)
|
||||
import Data.Text (Text)
|
||||
import Language.GraphQL.Trans
|
||||
import Language.GraphQL.Type
|
||||
|
||||
-- * Data
|
||||
-- See https://github.com/graphql/graphql-js/blob/master/src/__tests__/starWarsData.js
|
||||
@ -190,8 +191,8 @@ getDroid' _ = empty
|
||||
getFriends :: Character -> [Character]
|
||||
getFriends char = catMaybes $ liftA2 (<|>) getDroid getHuman <$> friends char
|
||||
|
||||
getEpisode :: Alternative f => Int -> f Text
|
||||
getEpisode 4 = pure "NEWHOPE"
|
||||
getEpisode 5 = pure "EMPIRE"
|
||||
getEpisode 6 = pure "JEDI"
|
||||
getEpisode :: Int -> Maybe (Wrapping Text)
|
||||
getEpisode 4 = pure $ Named "NEWHOPE"
|
||||
getEpisode 5 = pure $ Named "EMPIRE"
|
||||
getEpisode 6 = pure $ Named "JEDI"
|
||||
getEpisode _ = empty
|
||||
|
Reference in New Issue
Block a user