{"id":14976212,"url":"https://github.com/green-labs/tools.graphql","last_synced_at":"2025-10-27T18:30:44.338Z","repository":{"id":197793579,"uuid":"699350933","full_name":"green-labs/tools.graphql","owner":"green-labs","description":"Clojure tools for GraphQL","archived":false,"fork":false,"pushed_at":"2025-08-22T05:19:57.000Z","size":118,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-08-22T07:24:01.339Z","etag":null,"topics":["clojure","graphql","lacinia"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/green-labs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-02T13:15:07.000Z","updated_at":"2025-08-14T09:35:27.000Z","dependencies_parsed_at":"2024-04-29T03:30:38.100Z","dependency_job_id":"bdf0dce5-97f1-412b-aef9-7143721a0302","html_url":"https://github.com/green-labs/tools.graphql","commit_stats":{"total_commits":55,"total_committers":7,"mean_commits":7.857142857142857,"dds":0.3090909090909091,"last_synced_commit":"a9c87c8cb91a47e55b5b76d58f8e0856e045555d"},"previous_names":["green-labs/tools.graphql"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/green-labs/tools.graphql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-labs%2Ftools.graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-labs%2Ftools.graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-labs%2Ftools.graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-labs%2Ftools.graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/green-labs","download_url":"https://codeload.github.com/green-labs/tools.graphql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-labs%2Ftools.graphql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281319789,"owners_count":26481063,"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","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["clojure","graphql","lacinia"],"created_at":"2024-09-24T13:53:31.012Z","updated_at":"2025-10-27T18:30:43.931Z","avatar_url":"https://github.com/green-labs.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# tools.graphql\n\n[![Clojars Project](https://img.shields.io/clojars/v/org.clojars.greenlabs/tools.graphql.svg)](https://clojars.org/org.clojars.greenlabs/tools.graphql)\n\nThis library provides various tools related to GraphQL.\n\n1. [Convert EDN Schema to SDL](#convert-edn-schema-to-sdl)\n2. [Merge EDN Schemas](#merge-edn-schemas)\n3. [Schema Static Analysis](#schema-static-analysis)\n\n## Installation\n\nYou can install this library using the Clojure CLI tool.\n\n```sh\nclojure -Ttools install-latest :lib io.github.green-labs/tools.graphql :as graphql\n```\n\n### Convert EDN Schema to SDL\n\nWhen using the Lacinia library, you need to write the schema in EDN format. If you want to convert it to GraphQL SDL format, you can use the `edn2sdl` API.\n\n```sh\nclojure -Tgraphql edn2sdl \\\n  :input-path '\"path/to/schema.edn\"' \\\n  :output-path '\"path/to/schema.graphql\"'\n```\n\n### Merge EDN Schemas\n\nAs your service grows, it may be convenient to write the EDN schema in multiple files. However, Lacinia can only read a single schema.\n\nAlthough it is possible to merge and load these at runtime, this approach is not recommended. It can be difficult to ensure that there are no conflicts between the schemas or that all necessary fields are defined.\n\nTherefore, you might want to have a separate build step to merge the schemas. You can use the `stitch-schemas` API for this purpose.\n\n```sh\nclojure -Tgraphql stitch-schemas \\\n  :input-paths '[\"path/to/schema1/\" \"path/to/schema2/\"]' \\\n  :output-path '\"path/to/schema.edn\"'\n```\n\nThe `stitch-schemas` function will only generate the final schema if it can merge the schemas reliably.\n\nIf you frequently need to merge schemas during development, you can add the `:watch true` parameter to enable the watch feature.\n\nNote: It is recommended to version control the stitched schema alongside with subschemas.\n\n### Schema Static Analysis\n\nTo maintain consistency and avoid using incorrect fields or types when writing your schema, you might need a tool to assist you, especially as the schema grows larger and more complex. For this, you can use the `validate` API.\n\n```sh\nclojure -Tgraphql validate :input-path '\"path/to/schema.edn\"'\n```\n\nThis command will identify unused `type`, `input`, `enum`, `union`, and `interface`.\n\nExample:\n\n```text\nUnreachable type UrlConnection bases/core-api/resources/schema/common.edn:62:30\nUnreachable type UserAddressConnection\nUnreachable type YoutubeConnection\nUnreachable input GroupMembershipUpdateInput bases/core-api/resources/schema/farming_group.edn:238:3\nUnreachable input ProductionCategoryCodeInput bases/core-api/resources/schema/pesticide.edn:141:47\nUnreachable interface Node bases/core-api/resources/schema/common.edn:6:1\n```\n\nTo output the location in the subschema, you must set `:source-map?` option to true when stitching.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreen-labs%2Ftools.graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreen-labs%2Ftools.graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreen-labs%2Ftools.graphql/lists"}