Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
piq9117 51dac7c554 added gitignore (#1) il y a 1 an
src/Data/Morpheus expored safehashmap constructor il y a 1 an
test new stuff il y a 1 an
.gitignore added gitignore (#1) il y a 1 an
LICENSE new stuff il y a 1 an
README.md new stuff il y a 1 an
changelog.md new stuff il y a 1 an
default.nix expored safehashmap constructor il y a 1 an
morpheus-graphql-core.cabal exposed all the modules il y a 1 an
package.yaml exposed all the modules il y a 1 an
shell.nix expored safehashmap constructor il y a 1 an

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)