{"id":15619732,"url":"https://github.com/drbragg/graphql-on-rails","last_synced_at":"2025-08-30T14:07:25.804Z","repository":{"id":122870569,"uuid":"129974331","full_name":"DRBragg/graphql-on-rails","owner":"DRBragg","description":"playing around with GraphQL","archived":false,"fork":false,"pushed_at":"2018-04-17T22:59:22.000Z","size":600,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-02T17:22:27.668Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","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/DRBragg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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":"2018-04-17T22:58:01.000Z","updated_at":"2018-04-17T22:59:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"581b946a-987b-432d-97d6-598c3a0c6784","html_url":"https://github.com/DRBragg/graphql-on-rails","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DRBragg%2Fgraphql-on-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DRBragg%2Fgraphql-on-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DRBragg%2Fgraphql-on-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DRBragg%2Fgraphql-on-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DRBragg","download_url":"https://codeload.github.com/DRBragg/graphql-on-rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240125305,"owners_count":19751686,"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-03T08:41:19.933Z","updated_at":"2025-02-22T04:24:55.847Z","avatar_url":"https://github.com/DRBragg.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQL on Rails\n\n![](./public/screenshot.png)\n\n## Join our Slack\n\n:point_right: [http://bit.ly/graphql-on-rails-slack](http://bit.ly/graphql-on-rails-slack)\n\n## Tech Stack\n\n* Ruby on Rails 5.2\n* GraphQL 1.8\n* Webpacker 3.4\n* React 16.2\n* React Apollo 2.1\n\n## Creating the app from scratch\n\n```\n\u003e brew install yarn\n\u003e gem install rails -v 5.2.0\n\u003e rails new graphql-on-rails --api --webpack=react\n\n\u003e cd graphql-on-rails\n\u003e bundle exec rails webpacker:binstubs --force\n```\n\n## Saving webpacker\n\n```\n\u003e yarn\n\u003e ./bin/webpack-dev-server\n\nThe CLI moved into a separate package: webpack-cli.\nPlease install 'webpack-cli' in addition to webpack itself to use the CLI.\n-\u003e When using npm: npm install webpack-cli -D\n-\u003e When using yarn: yarn add webpack-cli -D\nmodule.js:491\n    throw err;\n    ^\n\nError: Cannot find module 'webpack-cli/bin/config-yargs'\n    at Function.Module._resolveFilename (module.js:489:15)\n    at Function.Module._load (module.js:439:25)\n    at Module.require (module.js:517:17)\n    at require (internal/module.js:11:18)\n    at Object.\u003canonymous\u003e (graphql-on-rails/node_modules/webpack-dev-server/bin/webpack-dev-server.js:65:1)\n    at Module._compile (module.js:573:30)\n    at Object.Module._extensions..js (module.js:584:10)\n    at Module.load (module.js:507:32)\n    at tryModuleLoad (module.js:470:12)\n    at Function.Module._load (module.js:462:3)\n```\n\n[https://github.com/rails/webpacker/issues/1295](https://github.com/rails/webpacker/issues/1295)\n\n```\n\u003e yarn add webpack-cli -D\n\u003e ./bin/webpack-dev-server\n\ngraphql-on-rails/node_modules/webpack-dev-server/bin/webpack-dev-server.js:405\n    throw e;\n    ^\n\nTypeError: Cannot read property 'compile' of undefined\n    at addCompilerHooks (graphql-on-rails/node_modules/webpack-dev-server/lib/Server.js:71:15)\n    at new Server (graphql-on-rails/node_modules/webpack-dev-server/lib/Server.js:81:5)\n    at startDevServer (graphql-on-rails/node_modules/webpack-dev-server/bin/webpack-dev-server.js:398:14)\n    at processOptions (graphql-on-rails/node_modules/webpack-dev-server/bin/webpack-dev-server.js:361:5)\n    at Object.\u003canonymous\u003e (graphql-on-rails/node_modules/webpack-dev-server/bin/webpack-dev-server.js:504:1)\n    at Module._compile (module.js:573:30)\n    at Object.Module._extensions..js (module.js:584:10)\n    at Module.load (module.js:507:32)\n    at tryModuleLoad (module.js:470:12)\n    at Function.Module._load (module.js:462:3)\n\n```\n\n[https://github.com/rails/webpacker/issues/1303](https://github.com/rails/webpacker/issues/1303)\n\n```\n\u003e yarn upgrade webpack-dev-server@^2.11.1\n\u003e ./bin/webpack-dev-server\n```\n\n## Starting the application\n\n```\n\u003e bundle\n\u003e bundle exec rails s\n```\n\n## Adding react-router-dom\n\n```\n\u003e yarn add react-router-dom\n```\n\n## Adding GraphiQL\n\n```\n\u003e yarn add graphiql\n```\n\n## Adding models\n\n```\n\u003e bundle exec rails g model user name:string\n\u003e bundle exec rails g model post user:references title:string description:string content:text\n\u003e bundle exec rake db:create db:migrate db:seed\n```\n\n## Adding GraphQL\n\n```\n\u003e bundle exec rails generate graphql:install\n```\n\n## Adding Apollo Client\n\n```\n\u003e yarn add apollo-boost\n\u003e yarn add react-apollo\n```\n\n## Adding Flow\n\n```\n\u003e yarn add -D apollo-codegen\n\u003e yarn graphql\n\n\u003e yarn add -D babel-preset-flow\n\u003e yarn add -D flow-bin\n\u003e flow init\n\u003e yarn flow\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrbragg%2Fgraphql-on-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrbragg%2Fgraphql-on-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrbragg%2Fgraphql-on-rails/lists"}