{"id":15568660,"url":"https://github.com/weakky/nexus-cli","last_synced_at":"2025-07-24T08:06:39.909Z","repository":{"id":96187141,"uuid":"186014734","full_name":"Weakky/nexus-cli","owner":"Weakky","description":"temp repo for nexus-cli \u0026 sf","archived":false,"fork":false,"pushed_at":"2020-06-06T20:13:31.000Z","size":78,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-03T17:06:56.830Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Weakky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-10T15:47:36.000Z","updated_at":"2019-05-23T09:26:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"a81038dd-0595-45b5-94e2-d9a1b480398a","html_url":"https://github.com/Weakky/nexus-cli","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"4bcbafdf6ee85fb9374e39ec2e6184e0815e9106"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weakky%2Fnexus-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weakky%2Fnexus-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weakky%2Fnexus-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weakky%2Fnexus-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Weakky","download_url":"https://codeload.github.com/Weakky/nexus-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246145079,"owners_count":20730495,"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-10-02T17:20:25.871Z","updated_at":"2025-03-29T06:10:20.123Z","avatar_url":"https://github.com/Weakky.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yoga\n\nA lightweight 'Ruby on Rails'-like framework for GraphQL\n\n\u003e Note: This project is still very WIP\n\n## What is Yoga?\n\nYoga is a GraphQL framework built with _conventions over configurations_ in mind.\nIts goal is to help you get setup as quick as possible and to boost your daily productivity while allowing you to eject at any moment so that you're not locked when more flexibility is needed.\n\nWe take care of the boilerplate, you focus on the business logic.\n\n## Features\n\n- Type-safe\n- Zero-config\n- Scalable\n- Conventions over configuration\n- Resolver-first GraphQL\n- Batteries included (DB, Auth, rate limiting, ...)\n- Deploy anywhere\n\n### What sort of abstraction does Yoga provide ?\n\nYoga is shipped with several technologies embedded such as a **GraphQL server**, a **database** to persist your data, and a **[library](https://graphql-nexus.com/)** to easily maintain and scale your server.\n\nThanks to _opinionated conventions_, Yoga offers built-in integration tools to better your daily workflows when crafting your GraphQL server:\n\n- Speed-up your productivity with the **interactive scaffolding commands**.\n- **Deploy anywhere** with the build command to deploy to any plateform\n- Solve the usual **N+1 problem with ease** thanks to the integrated built-in dataloading helpers\n- Optimized typescript **live reload**\n- Easily **handle authentication and permissions**\n- **Bootstrap** a customised, fully ready-to-use GraphQL server based on a datamodel\n\n## Get started\n\n### Start from scratch\n\nBootstrap a GraphQL server with a ready-made `yoga` setup then\nstart the server:\n\n```bash\nnpm init yoga my-app\ncd my-app\nnpm start\n```\n\nThat's it, you're ready to start 🙌\n\n### Add to existing project\n\n#### Install\n\nYou can install `yoga` with either of the following commands:\n\n```bash\nnpm install --save yoga\n```\n\nand add a script to your package.json like this:\n\n```json\n{\n  \"scripts\": {\n    \"dev\": \"yoga dev\"\n  }\n}\n```\n\nYou can now run\n\n```bash\nnpm run dev\n```\n\nThat's it, you're ready to start 🙌\n\n## Usage\n\n### Basics\n\nThe following is the tree structure needed for `yoga` to work\n\n```\nsrc\n├── context.ts (optional)\n└── graphql\n    ├── Query.ts\n    └── User.ts\n```\n\nThe `./src/graphql` folder is the entry point of your GraphQL server.\n\nEvery `.ts` file within that directory that exposes some GraphQL types will be processed, and exposed through a GraphQL server\n\n_eg:_\n\n```ts\n// ./src/graphql/Query.ts\nimport { objectType } from \"yoga\";\n\nexport const Query = objectType(\"Query\", t =\u003e {\n  t.string(\"hello\", {\n    resolve: () =\u003e \" world!\"\n  });\n});\n```\n\nOptionally, you can also provide a `./src/context.ts` file to inject anything to the context of your resolvers.\n\nThat file needs to default export a function returning an object containing what you want to put within your resolvers' context.\n\n_eg:_\n\n```ts\n// ./src/context.ts\nimport something from \"somewhere\";\n\nexport default () =\u003e ({ something });\n```\n\n### The CLI\n\n`yoga` ships itself with a CLI.\n\n```\nUsage: yoga \u003ccommand\u003e [options]\n\nCommands:\n  yoga new       Create new yoga project from template\n  yoga start     Start the server\n  yoga dev       Start the server in dev mode\n  yoga scaffold  Scaffold a new GraphQL type\n  yoga build     Build a yoga server\n\nOptions:\n  --version   Show version number                                      [boolean]\n  -h, --help  Show help                                                [boolean]\n```\n\n`yoga dev` will run a GraphQL server in watch mode, updating your server whenever a file change.\n\n### Configuration\n\n`yoga` comes with a default set of options (convention over configuration), but if you need to change them you can do so in the `yoga.config.ts`. Below is a table of all options, their types, and short descriptions.\n\n| Key                         | Type                                                            | Default | Note                                                                                                                                                                                                                                              |\n| --------------------------- | --------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `resolversPath`                  | `string` | `./src/graphql/`  | Path to the directory where your resolvers are defined. **If provided, path has to exist.** |\n| `contextPath` | `string` | `./src/context.ts` | Path to your `context.ts` file. **If provided, path has to exist.** |\n| `ejectFilePath` | `string` | `./src/server.ts` | Path to an `server.ts` file to eject from default configuration `yoga.config.ts`. When provided, all other configuration properties are ignored and should be configured programatically. **If provided, path has to exist.** |\n| `output` | [`InputOutputFilesConfig`](/packages/yoga/src/types.ts#L25) | See below. | Configuration for the outputted files (schema, typings, etc). |\n| `prisma` | [`InputPrismaConfig`](/packages/yoga/src/types.ts#L9) | See below. | Configuration for the Prisma integration. |\n\n#### InputOutputFilesConfig\n\n| Key                         | Type                                                            | Default | Note                                                                                                                                                                                                                                              |\n| --------------------------- | --------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `typegenPath` | `string` | `./.yoga/nexus.ts`  | Path to the generated typings. |\n| `schemaPath` | `string` | `./src/schema.graphql` | Path to the generated schema. |\n\n#### InputPrismaConfig\n\n| Key                         | Type                                                            | Default | Note                                                                                                                                                                                                                                              |\n| --------------------------- | --------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `datamodelInfoPath` | `string` | `null`  | The default exported object generated by `nexus-prisma-generate`. Import it from the output directory generated by `nexus-prisma-generate` |\n| `client` | [`PrismaClientInput`](https://github.com/prisma/nexus-prisma/blob/04a24271ae3b7d3cbee3318bc15c4b07cb70cd65/packages/nexus-prisma/src/types.ts#L99) | `./.yoga/prisma-client/index.ts` | Instance of the `prisma-client`, either passed statically or returned from the context defined in your GraphQL server. |\n\n\n## Contributing\n\nInstall dependencies\n\n```bash\nnpm install\nnpm run bootstrap\n```\n\nMove onto the `./example` folder at the root of the repository (the example is used to test `yoga` locally)\n\n```bash\ncd ./example\n```\n\nAnd run `yoga`\n\n```\nnpm run yoga\n```\n\nThe server should start. You're ready to help 🙏\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweakky%2Fnexus-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweakky%2Fnexus-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweakky%2Fnexus-cli/lists"}