No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
piq9117 51dac7c554 added gitignore (#1) hace 2 años
src/Data/Morpheus expored safehashmap constructor hace 2 años
test new stuff hace 2 años
.gitignore added gitignore (#1) hace 2 años
LICENSE new stuff hace 2 años
README.md new stuff hace 2 años
changelog.md new stuff hace 2 años
default.nix expored safehashmap constructor hace 2 años
morpheus-graphql-core.cabal exposed all the modules hace 2 años
package.yaml exposed all the modules hace 2 años
shell.nix expored safehashmap constructor hace 2 años

README.md

Morpheus GraphQL Core

core Functionalities of Morpheus GraphQL, can be used to build GraphQL server, client ..

  • parser
  • validar
  • api

Build GraphQL api with Core

schema :: Schema VALID
schema =
  [dsl|
  type Query {
    deity(name: String): Deity!
  }

  type Deity {
    name: String!
    power: [String!]!
  }
|]

resolver :: Monad m => RootResModel e m
resolver =
  RootResModel
    { query =
        pure $
          mkObject
            "Query"
            [("deity", resolveDeity)],
      mutation = pure mkNull,
      subscription = pure mkNull
    }

resolveDeity :: (WithOperation o, Monad m) => Resolver o e m (ResModel o e m)
resolveDeity =
  pure $
    mkObject
      "Deity"
      [ ("name", pure $ mkString "Morpheus"),
        ("power", pure $ mkList [mkString "Shapeshifting"])
      ]

api :: ByteString -> IO  ByteString
api = runApp (mkApp schema resolver)