{"id":13682516,"url":"https://github.com/howtographql/graphql-ruby","last_synced_at":"2025-04-07T11:10:50.407Z","repository":{"id":51286635,"uuid":"94226442","full_name":"howtographql/graphql-ruby","owner":"howtographql","description":"GraphQL Ruby example for How To GraphQL","archived":false,"fork":false,"pushed_at":"2021-05-17T17:47:21.000Z","size":132,"stargazers_count":265,"open_issues_count":4,"forks_count":61,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T10:06:13.894Z","etag":null,"topics":["graphql","graphql-server","rails","ruby","tutorial"],"latest_commit_sha":null,"homepage":"https://www.howtographql.com/graphql-ruby/0-introduction/","language":"Ruby","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/howtographql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-13T15:11:45.000Z","updated_at":"2025-02-25T17:23:50.000Z","dependencies_parsed_at":"2022-09-24T13:11:54.462Z","dependency_job_id":null,"html_url":"https://github.com/howtographql/graphql-ruby","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/howtographql%2Fgraphql-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howtographql%2Fgraphql-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howtographql%2Fgraphql-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howtographql%2Fgraphql-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/howtographql","download_url":"https://codeload.github.com/howtographql/graphql-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640465,"owners_count":20971557,"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-server","rails","ruby","tutorial"],"created_at":"2024-08-02T13:01:47.385Z","updated_at":"2025-04-07T11:10:50.384Z","avatar_url":"https://github.com/howtographql.png","language":"Ruby","readme":"# graphql-ruby\n\n## Installation\n\nInstall dependencies:\n\n```\nbundle install\n\nrails db:setup\n```\n\nStarting the server:\n\n```\nrails server\n```\n\nOpening the application:\n\n```\nopen http://localhost:3000/\n```\n\n## Interesting Files:\n\n- [GraphqlController](https://github.com/howtographql/graphql-ruby/blob/master/app/controllers/graphql_controller.rb) - GraphQL controller (api entry point)\n- [GraphqlTutorialSchema](https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/graphql_tutorial_schema.rb) - the schema definition\n- [Mutations](https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/types/mutation_type.rb) - root mutations\n- [Queries](https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/types/query_type.rb) - root queries\n- [UserType](https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/types/user_type.rb) - record type\n- [VoteType](https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/types/vote_type.rb) - record type\n- [LinkType](https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/types/link_type.rb) - record type\n- [DateTimeType](https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/types/date_time_type.rb) - scalar type\n- [LinksSearch](https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/resolvers/links_search.rb) - complex search resolver and its [tests](https://github.com/howtographql/graphql-ruby/blob/master/test/graphql/resolvers/links_search_test.rb)\n- [CreateLink](https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/mutations/create_link.rb) - mutation and its [tests](https://github.com/howtographql/graphql-ruby/blob/master/test/graphql/mutations/create_link_test.rb)\n- [CreateUser](https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/mutations/create_user.rb) - mutation and its [tests](https://github.com/howtographql/graphql-ruby/blob/master/test/graphql/mutations/create_user_test.rb)\n- [CreateVote](https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/mutations/create_vote.rb) - mutation and its [tests](https://github.com/howtographql/graphql-ruby/blob/master/test/graphql/mutations/create_vote_test.rb)\n- [SignInUser](https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/mutations/sign_in_user.rb) - mutation and its [tests](https://github.com/howtographql/graphql-ruby/blob/master/test/graphql/mutations/sign_in_user_test.rb)\n\n## Sample GraphQL Queries\n\nList first 10 links, containing \"example\":\n\n```graphql\n{\n  allLinks(first: 10, filter: {descriptionContains: \"example\"}) {\n    id\n    url\n    description\n    createdAt\n    postedBy {\n      id\n      name\n    }\n  }\n}\n\n```\n\nCreates new user:\n\n```graphql\nmutation {\n  createUser(\n    name: \"Radoslav Stankov\",\n    authProvider: {\n      credentials: { email: \"rado@example.com\", password: \"123456\" }\n    }\n  ) {\n    id\n    email\n    name\n  }\n}\n```\n\nCreates new user token:\n\n```graphql\nmutation {\n  signinUser(credentials: {email: \"rado@example.com\", password: \"123456\"}) {\n    token\n    user {\n      id\n      email\n      name\n    }\n  }\n}\n```\n\nCreates new link:\n\n```graphql\nmutation {\n  createLink(url:\"http://example.com\", description:\"Example\") {\n    id\n    url\n    description\n    postedBy {\n      id\n      name\n    }\n  }\n}\n```\n\nCreates new vote:\n\n```graphql\nmutation {\n  createVote(linkId:\"TGluay0yMQ==\") {\n    user {\n      id\n      name\n    }\n    link {\n      id\n      url\n      description\n    }\n  }\n}\n```\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowtographql%2Fgraphql-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhowtographql%2Fgraphql-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowtographql%2Fgraphql-ruby/lists"}