{"id":18681288,"url":"https://github.com/morpheusgraphql/morpheus-graphql-cli","last_synced_at":"2025-04-12T04:07:23.245Z","repository":{"id":48073600,"uuid":"218881151","full_name":"morpheusgraphql/morpheus-graphql-cli","owner":"morpheusgraphql","description":"Code Generator for Morpheus GraphQL","archived":false,"fork":false,"pushed_at":"2021-08-08T22:50:05.000Z","size":111,"stargazers_count":13,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-02T19:45:43.553Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/morpheusgraphql.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-01T00:00:26.000Z","updated_at":"2022-02-17T18:29:51.000Z","dependencies_parsed_at":"2022-08-12T18:00:55.201Z","dependency_job_id":null,"html_url":"https://github.com/morpheusgraphql/morpheus-graphql-cli","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpheusgraphql%2Fmorpheus-graphql-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpheusgraphql%2Fmorpheus-graphql-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpheusgraphql%2Fmorpheus-graphql-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpheusgraphql%2Fmorpheus-graphql-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morpheusgraphql","download_url":"https://codeload.github.com/morpheusgraphql/morpheus-graphql-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223494314,"owners_count":17154526,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T10:06:47.794Z","updated_at":"2024-11-07T10:06:48.482Z","avatar_url":"https://github.com/morpheusgraphql.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"# Morpheus GraphQL CLI\n\nMorpheus GraphQL CLI helps you to generate GraphQL APIs .\n\nMorpheus GraphQL CLI is still in an early stage of development, so any feedback is more than welcome, and we appreciate any contribution!\nJust open an issue here on GitHub, or join [our Slack channel](https://morpheus-graphql-slack-invite.herokuapp.com/) to get in touch.\n\n## Getting Started\n\n### Setup\n\nTo get started with Morpheus, you first need to add it to your project's dependencies, as follows (assuming you're using hpack):\n\n_package.yml_\n\n```yaml\ndependencies:\n  - morpheus-graphql-cli\n```\n\nAdditionally, you should tell stack which version to pick:\n\n_stack.yml_\n\n```yaml\nresolver: lts-14.8\n\nextra-deps:\n  - morpheus-graphql-0.5.0\n```\n\nAs Morpheus and is quite new, make sure stack can find morpheus-graphql by running `stack upgrade` and `stack update`\n\n## Code Generating\n\nGenerating dummy Morpheus Api from `schema.gql`\n\n```\nmorpheus build src/schem.gql src/GQLApi.hs\n```\n\n_schema.gql_\n\n```gql\ntype Query {\n  deity(name: String!): Deity!\n}\n\ntype Deity {\n  name: String!\n  power: String\n}\n```\n\n_API.hs_\n\n```haskell\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE DeriveGeneric #-}\n{-# LANGUAGE TypeFamilies #-}\n\n-- generated by 'Morpheus' CLI\nmodule API (rootResolver) where\n\nimport  GHC.Generics  (Generic)\nimport  Data.Morpheus.Kind  (SCALAR, ENUM, INPUT_OBJECT, OBJECT, UNION)\nimport  Data.Morpheus.Types  (GQLRootResolver(..), toMutResolver, IORes, IOMutRes, IOSubRes, Event(..), SubRootRes, GQLType(..), GQLScalar(..), ScalarValue(..))\nimport  Data.Text  (Text)\n\nrootResolver :: GQLRootResolver IO () () Query () ()\nrootResolver =\n  GQLRootResolver\n    { queryResolver = resolveQuery\n  ,  mutationResolver = return ()\n  ,  subscriptionResolver = return ()\n    }\n\n\n\n\n---- GQL Query -------------------------------\ndata Query = Query\n    { deity :: ArgDeity -\u003e IORes Deity\n    }\n deriving (Generic)\n\ndata ArgDeity = ArgDeity\n    { name :: Text\n    }\n deriving (Generic)\n\ninstance GQLType Query where\n  type KIND Query = OBJECT\n\n\n\nresolveQuery :: IORes Query\nresolveQuery = return Query\n    { deity = const resolveDeity\n    }\n\n\n\n\n---- GQL Deity -------------------------------\ndata Deity = Deity\n    { name :: () -\u003e IORes Text\n  ,  power :: () -\u003e IORes (Maybe Text)\n    }\n deriving (Generic)\n\ninstance GQLType Deity where\n  type KIND Deity = OBJECT\n\n\n\nresolveDeity :: IORes Deity\nresolveDeity = return Deity\n    { name = const $ return \"\"\n  ,  power = const $ return Nothing\n    }\n```\n\nthis command will generate Haskell API and resolvers,\nresolvers will resolve default values for every object\n\n# About\n\n## The name\n\n_Morpheus_ is the greek god of sleep and dreams whose name comes from the greek word _μορφή_ meaning form or shape.\nHe is said to be able to mimic different forms and GraphQL is good at doing exactly that: Transforming data in the shape\nof many different APIs.\n\n## Team\n\nMorpheus is written and maintained by [_nalchevanidze_](https://github.com/nalchevanidze)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpheusgraphql%2Fmorpheus-graphql-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorpheusgraphql%2Fmorpheus-graphql-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpheusgraphql%2Fmorpheus-graphql-cli/lists"}