{"id":37099462,"url":"https://github.com/granateio/granate","last_synced_at":"2026-01-14T12:07:09.079Z","repository":{"id":57498855,"uuid":"91390561","full_name":"granateio/granate","owner":"granateio","description":"Code generator for graphql","archived":false,"fork":false,"pushed_at":"2018-07-20T11:24:33.000Z","size":75,"stargazers_count":22,"open_issues_count":9,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-12-20T18:58:37.922Z","etag":null,"topics":["api","code-generation","go","golang","graphql","schema","server"],"latest_commit_sha":null,"homepage":"","language":"Go","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/granateio.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-05-15T22:31:05.000Z","updated_at":"2022-10-13T12:08:54.000Z","dependencies_parsed_at":"2022-09-06T17:11:38.156Z","dependency_job_id":null,"html_url":"https://github.com/granateio/granate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/granateio/granate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/granateio%2Fgranate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/granateio%2Fgranate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/granateio%2Fgranate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/granateio%2Fgranate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/granateio","download_url":"https://codeload.github.com/granateio/granate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/granateio%2Fgranate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","code-generation","go","golang","graphql","schema","server"],"created_at":"2026-01-14T12:07:08.333Z","updated_at":"2026-01-14T12:07:09.074Z","avatar_url":"https://github.com/granateio.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# !WORK IN PROGRESS!\n\n# Granate - Code generator for graphql\n`Granate` is a tool meant to speed up development of applications that utilises\ngraphql. `Granate` takes a graphql `schema` and outputs code based on the\nspecified language.\n\n### Supported languages\n\n- Go\n\n## Quick start\n### Install\n```sh\ngo get github.com/granateio/granate\n```\n\n### Usage\n`Granate` requires a config yaml file `granate.yaml` to provide some basic\ninformation about the project.\n```yaml\n# Select language to output\nlanguage: go\n\n# Output locations (and some options)\noutput:\n  # Output target directory (value can be empty,\n  # but the option is currently required)\n  target: \u003ctarget-dir\u003e\n\n  # Name of the package\n  package: change.me/your/package-name/\u003ctarget-dir\u003e\n\n  # Name of the package to generate for the schema\n  schema: schema\n\n  # Name of the package to generate for the models\n  models: models\n\n# Schemas to use for the code generator\nschemas:\n  - schema.graphql\n```\n\nA schema is also required, you can provide multiple schemas in the `schemas`\nsection of the config file. Here is a simple `todo.graphql` file\n```graphql\n# A user in the system\ntype User {\n    id: ID\n    name: String\n    todos: [Todo]\n}\n\n# A todo\ntype Todo {\n    id: ID\n    title: String\n    description: String\n}\n\n# Root query\ntype Query {\n    # Get the current loged in user\n    viewer: User\n}\n\n```\n\nBy simply running `granate` in the same folder as the `granate.yaml` or placing\n`//go:generate granate` at the top of your `main.go` file and running `go\ngenerate`, three files will be created.\n```\nschema/\n- definitions.go\n- adapters.go\n- provider.go\n```\n\nThe `definitions.go` file is where all the graphql specific code is.\n`adapters.go` provides a set of interfaces to use for implementing the logic.\n`provider.go` contains a set of function to bootstrap the graphql schema as\nwell as providing a graphiql interface to test your schema with.\n\nFor a more in depth overview of how to use `Granate`, check out the simple example under the `example` folder.\n\n## Unsupported features\n\nWe support most graphql features. These are examples of things you can't yet\ngenerate with granate.\n\n```graphql\n# Define interfaces (the only interface you can use for now is Node, which exists)\ninterface Entity {\n    id: ID!\n    name: String\n}\n\n# Define scalars\nscalar URL\n\n# Define unions\nunion Animal = Dog | Snake\n\n# Define schemas\n# You shouldn't need to do this\nschema {\n    query: Query\n    mutation: Mutation\n    subscription: ...\n}\n```\n\nSee the [GraphQL\ncheat sheet](https://wehavefaces.net/graphql-shorthand-notation-cheatsheet-17cd715861b6)\nfor reference.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgranateio%2Fgranate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgranateio%2Fgranate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgranateio%2Fgranate/lists"}