{"id":13748966,"url":"https://github.com/itsezc/crystal-gql","last_synced_at":"2025-05-12T23:23:54.138Z","repository":{"id":52169167,"uuid":"251234409","full_name":"itsezc/crystal-gql","owner":"itsezc","description":"A complete GraphQL client shard for the Crystal language inspired by Apollo client including error handling and planned support for caching, authentication and subscriptions.","archived":false,"fork":false,"pushed_at":"2021-05-06T15:00:19.000Z","size":26,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T04:41:27.712Z","etag":null,"topics":["crystal-gql","crystal-language","crystal-shard","graphql"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/itsezc.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":"2020-03-30T07:38:45.000Z","updated_at":"2024-04-26T11:36:31.000Z","dependencies_parsed_at":"2022-09-23T16:00:26.922Z","dependency_job_id":null,"html_url":"https://github.com/itsezc/crystal-gql","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/itsezc%2Fcrystal-gql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsezc%2Fcrystal-gql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsezc%2Fcrystal-gql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsezc%2Fcrystal-gql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsezc","download_url":"https://codeload.github.com/itsezc/crystal-gql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253838521,"owners_count":21972175,"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":["crystal-gql","crystal-language","crystal-shard","graphql"],"created_at":"2024-08-03T07:00:53.336Z","updated_at":"2025-05-12T23:23:54.083Z","avatar_url":"https://github.com/itsezc.png","language":"Crystal","funding_links":[],"categories":["Libraries","Crystal","Implementations"],"sub_categories":["Crystal Libraries","Crystal"],"readme":"# GraphQL Client for Crystal\n\nA GraphQL client shard for the Crystal language.\n\n- Version: 0.1.3\n- Crystal Version: 0.35.1\n\n## Usage\n\n**Installing**\n\nJust add this to your shards.yml file:\n\n```yml\ndependencies:\n\n  crystal-gql:\n    github: itsezc/crystal-gql\n\n```\n\nThen run:\n\n```bash\nshards install\n```\n\n**Initializing**\n\n```ruby\nrequire \"crystal-gql\"\n\n# Define the client\napi = GraphQLClient.new \"https://countries.trevorblades.com\"\n```\n\n**Querying**\n\n```ruby\n# useQuery\ndata, error, loading = api.useQuery(GQL {\n\t\"continents\" =\u003e [\n\t\t\"code\",\n\t\t\"name\",\n\t\t{\n\t\t\t\"countries\" =\u003e [\n\t\t\t\t\"name\",\n\t\t\t\t\"capital\",\n\t\t\t\t{\n\t\t\t\t\t\"languages\" =\u003e [\n\t\t\t\t\t\t\"name\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n})\n\n# or traditional queries\ndata, error, loading = api.query(\"{\n    continents {\n        code\n        name\n    \tcountries {\n      \t\tname\n      \t\tcapital\n      \t\tlanguages {\n        \t\t\tname\n      \t\t}\n    \t}\n    }\n}\")\n\n# Print data\nprint data\n```\n\n**Querying**\n\nWith authentication:\n\n\n```ruby\napi.add_header(\"Authorization\", \"Bearer: TOKEN\")\n# useQuery\ndata, error, loading = api.useQuery(GQL {\n\t\"continents\" =\u003e [\n\t\t\"code\",\n\t\t\"name\",\n\t\t{\n\t\t\t\"countries\" =\u003e [\n\t\t\t\t\"name\",\n\t\t\t\t\"capital\",\n\t\t\t\t{\n\t\t\t\t\t\"languages\" =\u003e [\n\t\t\t\t\t\t\"name\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsezc%2Fcrystal-gql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsezc%2Fcrystal-gql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsezc%2Fcrystal-gql/lists"}