{"id":15284336,"url":"https://github.com/gingray/rspec-graphql_assistant","last_synced_at":"2025-04-12T23:22:04.467Z","repository":{"id":56892874,"uuid":"279588643","full_name":"gingray/rspec-graphql_assistant","owner":"gingray","description":"Collection of RSpec helpers to easy test GraphQL query, mutation, subscription","archived":false,"fork":false,"pushed_at":"2022-07-22T08:23:09.000Z","size":31,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T17:21:23.200Z","etag":null,"topics":["graphql","rails","rspec"],"latest_commit_sha":null,"homepage":"","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/gingray.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":"2020-07-14T13:11:15.000Z","updated_at":"2024-02-08T13:41:29.000Z","dependencies_parsed_at":"2022-08-20T16:10:34.599Z","dependency_job_id":null,"html_url":"https://github.com/gingray/rspec-graphql_assistant","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/gingray%2Frspec-graphql_assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gingray%2Frspec-graphql_assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gingray%2Frspec-graphql_assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gingray%2Frspec-graphql_assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gingray","download_url":"https://codeload.github.com/gingray/rspec-graphql_assistant/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248644185,"owners_count":21138565,"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","rails","rspec"],"created_at":"2024-09-30T14:53:36.367Z","updated_at":"2025-04-12T23:22:04.440Z","avatar_url":"https://github.com/gingray.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rspec::GraphqlAssistant\nHelps you to generate query for testing GraphQL\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rspec-graphql_assistant'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install rspec-graphql_assistant\n\n## Usage\n\n```ruby\nRSpec.configure do |config|\n  config.include RSpec::GraphqlAssistant::Helpers\nend\n```\n\n```ruby\ngraphql_mutation('updatePost', { post_id: 1, content: \"some test\" }, [:id, author: [:name]])\n```\n\nproduce this one query\n```gql\nmutation {\n  updatePost(input: {postId: 1, content: \"some text\"}) {\n    id\n    author {\n      name\n  }\n}\n\n```\nExamples of query and subscription\n```ruby\nargs = {post_id: 1}\nresponse = [:id, :name]\n\ngraphql_query('queryName', args, response)\n\ngraphql_subscription('subscriptionName', args, response)\n```\n\n## Matchers\n```ruby\nexpect(result).to graphql_have_attributes([:book, :author_reviews], { score: 10 })\n```\nit's equivalent to `expect(result.dig('data', 'book', 'authorReviews')).to have_attributes({'score' =\u003e 10})`\n\n```ruby\nexpect(result).to graphql_include(:book, %w[id title])\n```\n\nit's equivalent to `expect(result.dig('data', 'book')).to include('id', 'title')`\n\nWork in progress and now only supports inline syntax. Which means without passing variables. Later try to cover both cases.  \nI'm still working on documentation if you want to help me be appreciated \n\nCheers\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/ginray/rspec-graphql_assistant.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgingray%2Frspec-graphql_assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgingray%2Frspec-graphql_assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgingray%2Frspec-graphql_assistant/lists"}