{"id":13513887,"url":"https://github.com/wormwood-elixir/wormwood","last_synced_at":"2026-02-20T16:01:33.802Z","repository":{"id":41309055,"uuid":"212437532","full_name":"wormwood-elixir/wormwood","owner":"wormwood-elixir","description":"Wormwood is a tiny library to aid in testing GraphQL queries against an Absinthe schema. It allows you to test your query documents inside ExUnit test modules, and requires no HTTP requests to occur during testing.","archived":false,"fork":false,"pushed_at":"2020-09-21T19:05:06.000Z","size":93,"stargazers_count":93,"open_issues_count":7,"forks_count":11,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-12-13T02:53:17.075Z","etag":null,"topics":["absinthe","elixir","exunit","graphql"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/wormwood","language":"Elixir","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/wormwood-elixir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-02T20:43:14.000Z","updated_at":"2024-12-09T02:51:01.000Z","dependencies_parsed_at":"2022-09-05T13:41:38.592Z","dependency_job_id":null,"html_url":"https://github.com/wormwood-elixir/wormwood","commit_stats":null,"previous_names":["tinfoil/wormwood"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wormwood-elixir/wormwood","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wormwood-elixir%2Fwormwood","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wormwood-elixir%2Fwormwood/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wormwood-elixir%2Fwormwood/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wormwood-elixir%2Fwormwood/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wormwood-elixir","download_url":"https://codeload.github.com/wormwood-elixir/wormwood/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wormwood-elixir%2Fwormwood/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29656589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["absinthe","elixir","exunit","graphql"],"created_at":"2024-08-01T05:00:39.563Z","updated_at":"2026-02-20T16:01:33.777Z","avatar_url":"https://github.com/wormwood-elixir.png","language":"Elixir","funding_links":[],"categories":["Elixir"],"sub_categories":[],"readme":"# Wormwood\n\n[![hex](https://img.shields.io/hexpm/v/wormwood.svg)](https://hex.pm/packages/wormwood)\n![Actions Status](https://github.com/tinfoil/wormwood/workflows/Elixir%20CI/badge.svg)\n[![license-mit](https://img.shields.io/badge/license-MIT-blue)](https://github.com/tinfoil/wormwood/blob/master/LICENSE)\n![graph-ql](https://img.shields.io/badge/%E2%99%A5-graphql-ff69b4)\n\nWormwood is a tiny library to aid in testing GraphQL queries against an Absinthe schema. It allows you to test your query documents inside ExUnit test modules, and requires no HTTP requests to occur during testing.\n\n#### Why Wormwood?\n\nWe believe that testing GraphQL queries should be easy. Wormwood lets you scope a test module to one single document (paired with a schema) with ease, and helps to remove any of the boilerplate code such a task would introduce.\n\nWith Wormwood, you simply load your document at the top of your module, and query it using a standard function. \n\nThat's it!\n\n----------\n\n### Installation\n\nInstall from [Hex.pm](https://hex.pm/packages/wormwood):\n\n```elixir\ndef deps do\n  [{:wormwood, \"~\u003e 0.1.0\"}]\nend\n```\n\n----------\n\n### Getting Started\n\n1. Install Wormwood!\n2. `use` the Wormwood GQLCase inside the test module...\n\n\t```elixir\n\tdefmodule MyCoolApplication.MyTestCase do\n\t  use ExUnit.Case\n\t  use Wormwood.GQLCase\n\t  #...\n\t```\t\n3. Use the Wormwood `load_gql/2` macro to specify your schema and load your GraphQL document...\n\n\t```elixir\n   defmodule MyCoolApplication.MyTestCase do\n\t  #...\n\t  \n\t  load_gql MyCoolApplication.MyAbsintheSchema, \"assets/js/queries/MyQuery.gql\"\n\t  \n\t  #...\n\t```\n\n4. Your document and schema are ready to go, you can now call `query_gql/1` inside any of your test statements to execute the loaded document against the specified schema. You can pass `options` to this call, please refer to the [Absinthe docs](https://hexdocs.pm/absinthe/Absinthe.html#run/3-options) for more information on options.\n\n\tFor Example:\n\t\n\t```elixir\n\t#...\n\t\n\ttest \"should be a valid query\" do\n\t  result = query_gql(variables: %{}, context: %{:current_user =\u003e some_user})\n\t  assert {:ok, _query_data} = result\n\tend\n\t\n\t#...\n\t```\n\n\n##### Full example from the above steps:\n\n```elixir\ndefmodule MyCoolApplication.MyTestCase do\n  use ExUnit.Case\n  use Wormwood.GQLCase\n\t  \n  load_gql MyCoolApplication.MyAbsintheSchema, \"assets/js/queries/MyQuery.gql\" \n\t  \n  test \"should be a valid query\" do\n    result = query_gql(variables: %{}, context: %{:current_user =\u003e some_user})\n    assert {:ok, _query_data} = result\n  end\nend\n```\n\n----------\n\n### Examples\n\nCheck out `lib/examples/` for a very simple, static, and self contained Absinthe schema. \n\nYou can also dig around in `test/examples/` for simple tests that query against that sample schema using Wormwood.\n\n----------\n\n### License\n\nCopyright © 2019 [Tinfoil Security Inc.](https://www.tinfoilsecurity.com/go/opensource)\n\nThis project is [MIT licensed](https://github.com/tinfoil/wormwood/blob/master/LICENSE).\n\n----------\n\n\u003cp align=\"center\"\u003e\n\tMade with ❤️ and 🔐 by Tinfoil Security\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwormwood-elixir%2Fwormwood","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwormwood-elixir%2Fwormwood","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwormwood-elixir%2Fwormwood/lists"}