{"id":13632720,"url":"https://github.com/graphql-compose/graphql-compose-examples","last_synced_at":"2025-04-05T11:12:39.303Z","repository":{"id":45054620,"uuid":"62406719","full_name":"graphql-compose/graphql-compose-examples","owner":"graphql-compose","description":"Live examples of schemas builded with graphql-compose ","archived":false,"fork":false,"pushed_at":"2023-01-06T01:43:30.000Z","size":10954,"stargazers_count":184,"open_issues_count":13,"forks_count":314,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-30T00:00:31.053Z","etag":null,"topics":["graphql","graphql-compose","graphql-server"],"latest_commit_sha":null,"homepage":"https://graphql-compose.herokuapp.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphql-compose.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["nodkz"],"patreon":null,"open_collective":"graphql-compose","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-07-01T16:41:48.000Z","updated_at":"2024-09-09T11:50:55.000Z","dependencies_parsed_at":"2023-02-05T02:00:16.114Z","dependency_job_id":null,"html_url":"https://github.com/graphql-compose/graphql-compose-examples","commit_stats":null,"previous_names":["nodkz/graphql-compose-examples"],"tags_count":73,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-compose%2Fgraphql-compose-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-compose%2Fgraphql-compose-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-compose%2Fgraphql-compose-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-compose%2Fgraphql-compose-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphql-compose","download_url":"https://codeload.github.com/graphql-compose/graphql-compose-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325695,"owners_count":20920714,"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":["graphql","graphql-compose","graphql-server"],"created_at":"2024-08-01T22:03:12.171Z","updated_at":"2025-04-05T11:12:39.284Z","avatar_url":"https://github.com/graphql-compose.png","language":"TypeScript","funding_links":["https://github.com/sponsors/nodkz","https://opencollective.com/graphql-compose"],"categories":["TypeScript"],"sub_categories":[],"readme":"## This is example app of `graphql-compose`\n\n[![Travis](https://img.shields.io/travis/graphql-compose/graphql-compose-examples.svg?maxAge=2592000)](https://travis-ci.org/graphql-compose/graphql-compose-examples)\n\nLive example on Heroku: [https://graphql-compose.herokuapp.com/](https://graphql-compose.herokuapp.com/)\n\n```bash\nyarn install\nyarn seed \u0026\u0026 yarn dev\nopen http://localhost:3000\n```\n\n\n## User: simple schema with one type\nThis [example](https://github.com/graphql-compose/graphql-compose-examples/tree/master/examples/user) has simple User mongoose model that supports bunch of CRUD operations.\n\n```js\nconst UserSchema = new mongoose.Schema({\n  name: String, // standard types\n  age: {\n    type: Number,\n    index: true,\n  },\n  languages: {\n    type: [LanguagesSchema], // you may include other schemas (here included as array of embedded documents)\n    default: [],\n  },\n  contacts: { // another mongoose way for providing embedded documents\n    email: String,\n    phones: [String], // array of strings\n  },\n  gender: { // enum field with values\n    type: String,\n    enum: ['male', 'female', 'ladyboy'],\n  },\n});\n```\n\n\u003cimg width=\"982\" alt=\"screen shot 2016-07-03 at 15 23 03\" src=\"https://cloud.githubusercontent.com/assets/1946920/16544733/9ef9b146-4132-11e6-8a90-8702d2474cfd.png\"\u003e\n\n\u003cimg width=\"1330\" alt=\"screen shot 2016-07-15 at 12 41 17\" src=\"https://cloud.githubusercontent.com/assets/1946920/16865833/7ec028c8-4a89-11e6-980e-e17745e5085c.png\"\u003e\n\n\n## User for Relay: simple schema with one type\n\nThis [schema](https://github.com/graphql-compose/graphql-compose-examples/tree/master/examples/userForRelay) shows all available CRUD operations which are compatible with Relay. It uses `graphql-compose-mongose` and `graphql-compose-relay`:\n- `composeWithRelay(RootQueryTC)` adds `node` field to the RootQuery. Via `RootQuery.node(id)` you may find objects by globally unique ID among all types.\n- `composeWithRelay(UserTC)` - modify `UserTC` generated by `graphql-compose-mongoose`  \n  - adds `id` field with Relay's globally unique ID\n  - this type will be added to `NodeInterface` for resolving via `RootQuery.node`\n  - for mutations will be added `clientMutationId` to input and output objects types\n  - also all arguments in mutations will be moved into `input` arg\n\n\u003cimg width=\"1362\" alt=\"screen shot 2017-03-13 at 10 20 34\" src=\"https://cloud.githubusercontent.com/assets/1946920/23841356/d3bd6f42-07d6-11e7-94f5-cc3618eaf45a.png\"\u003e\n\n\n## Northwind: complex schema with 8 models 🌶🌶🌶\n\nThis is a sample data of some trading company, which consists from 8 models. All models has cross-relations to each other. This schema used in the Relay example app: [Server schema code](https://github.com/graphql-compose/graphql-compose-examples/tree/master/examples/northwind), [Client app code](https://github.com/nodkz/relay-northwind-app), [Live demo of client](https://nodkz.github.io/relay-northwind/).\n\n![relay-northwind-app](https://cloud.githubusercontent.com/assets/1946920/18013918/488e6830-6be2-11e6-84b6-884c8ab971ac.gif)\n\n\n## Elasticsearch REST API wrapper\n\nThis [schema](https://github.com/graphql-compose/graphql-compose-examples/tree/master/examples/elasticsearch) uses [graphql-compose-elasticsearch](https://github.com/graphql-compose/graphql-compose-elasticsearch) module and  provides full API available in the official elasticsearch module.\n\n\u003cimg width=\"1316\" alt=\"screen shot 2017-03-07 at 22 26 17\" src=\"https://cloud.githubusercontent.com/assets/1946920/23841396/2c123b3c-07d7-11e7-8c83-ff01c98090fb.png\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-compose%2Fgraphql-compose-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphql-compose%2Fgraphql-compose-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-compose%2Fgraphql-compose-examples/lists"}