{"id":20519421,"url":"https://github.com/keremdokumaci/goql","last_synced_at":"2026-04-12T20:35:19.059Z","repository":{"id":68957158,"uuid":"597714815","full_name":"keremdokumaci/goql","owner":"keremdokumaci","description":"A GraphQL helper to deal with GraphQL requirements","archived":false,"fork":false,"pushed_at":"2023-02-26T01:18:08.000Z","size":152,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-01T16:11:24.731Z","etag":null,"topics":["cache","golang-package","gql","graphql","graphql-cache","graphql-caching","graphql-server","graphql-whitelist","whitelist"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keremdokumaci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["keremdokumaci"]}},"created_at":"2023-02-05T12:24:05.000Z","updated_at":"2023-04-11T16:08:39.000Z","dependencies_parsed_at":"2024-06-20T15:40:47.209Z","dependency_job_id":"13ecfc0d-3e3c-4e83-9906-c649cf739040","html_url":"https://github.com/keremdokumaci/goql","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/keremdokumaci/goql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keremdokumaci%2Fgoql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keremdokumaci%2Fgoql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keremdokumaci%2Fgoql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keremdokumaci%2Fgoql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keremdokumaci","download_url":"https://codeload.github.com/keremdokumaci/goql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keremdokumaci%2Fgoql/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265846884,"owners_count":23838160,"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":["cache","golang-package","gql","graphql","graphql-cache","graphql-caching","graphql-server","graphql-whitelist","whitelist"],"created_at":"2024-11-15T22:13:28.220Z","updated_at":"2026-04-12T20:35:14.028Z","avatar_url":"https://github.com/keremdokumaci.png","language":"Go","funding_links":["https://github.com/sponsors/keremdokumaci"],"categories":[],"sub_categories":[],"readme":"![Version](https://img.shields.io/badge/version-0.1.12-orange.svg)\n[![GolangCI Lint](https://github.com/keremdokumaci/goql/actions/workflows/go-lint.yml/badge.svg)](https://github.com/keremdokumaci/goql/actions/workflows/go-lint.yml)\n[![Golang Tests](https://github.com/keremdokumaci/goql/actions/workflows/go-test.yml/badge.svg)](https://github.com/keremdokumaci/goql/actions/workflows/go-test.yml)\n![Test Coverage](https://img.shields.io/badge/coverage-91.9%25-orange.svg)\n\n# GoQL\n\nA GraphQL helper to deal with GraphQL requirements. Written with *Go 1.19*\n\n## What does GoQL do ?\n\n💾 `Caching`\n\n🆘 `White Listing`\n\n*And other features **will be** supported by GoQL.*\n\n## Usage\n\nYou should create a **GoQL** instance at the beginning with using function\n\n```go\ngq := goql.New()\n```\n\nThere are some functions for initialization of GoQL instance.\n\n* ConfigureDB\n* ConfigureInmemoryCache\n* ConfigureRedisCache\n* UseWhitelister\n* UseGQLCacher\n\n### Database Configuration\n\nDatabase configuration is done by **ConfigureDB** function. It takes 2 parameters to configure database.\n\n* Database name (Such as ***postgres***,***mysql***)\n* Database instance (pointer of **sql.DB**)\n\n🆘 For now, **postgres** is the only supported db. However, **mysql**, **mssql** and other most known database systems will be integrated to GoQL.\n\n```go\ngq.ConfigureDB(constants.POSTGRES, db)\n```\n\n#### Database Migration\n\nSet your migration files directory as environment variable called **MIGRATION_DIR**. Then run\n\n```go\nmigrations.MigratePostgres(db)\n```\n\nRequired migration files can be found inside [migrations](./pkg/migrations/) folder. Migration files depends on database.\n\n### Cache Configuration\n\nCache configuration is done by **ConfigureInmemoryCache** and **ConfigureRedisCache** functions.\n\n```go\ngq.ConfigureInmemoryCache()\n```\n\n```go\ngq.ConfigureRedisCache(client)\n```\n\n### GQL Cacher\n\nFor caching GQL queries, you should run **UseGQLCacher** function. It returns **Cacher** and **error**.\n\n🚨 *Database and cache configuration is **mandatory** to use this feature.*\n\n\n```go\ncacher,err := gq.UseGQLCacher()\n```\n\n### Whitelister\n\nFor whitelisting, you should run **UseWhitelister** function. It returns **Whitelister** interface and **error**.\n\n🚨 *Database and cache configuration is **mandatory** to use this feature.*\n\n🚨 *Database migration is mandatory to use whitelister*\n\n### GQL Query Helper\n\n```go\nquery, err := query.Parse(\"a gql query\")\n```\n\nparses string query to [ast.Document](\"github.com/graphql-go/graphql/language/ast\").\n\nThere are some basic functions to get some specific data along query such as.\n\n```go\nqueryName := query.Name()\n```\n\nThere will be more different helper functions for GQL Operations.\n\n## Testing\n\nRun all tests\n\n```sh\nmake test\n```\n\nRun single test\n\n```sh\nmake test t=\"test_to_run\"\n```\n\nRun code coverate\n\n```sh\nmake test-coverage\n```\n\nBeside calculating code coverage, it replace code coverage badge on [README.md](./README.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeremdokumaci%2Fgoql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeremdokumaci%2Fgoql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeremdokumaci%2Fgoql/lists"}