{"id":28092448,"url":"https://github.com/bitquery/activecube-graphql","last_synced_at":"2025-05-13T13:16:00.710Z","repository":{"id":40759575,"uuid":"242340312","full_name":"bitquery/activecube-graphql","owner":"bitquery","description":"GraphQL Interface for Activecube Queries","archived":false,"fork":false,"pushed_at":"2024-08-06T06:34:51.000Z","size":52,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-13T13:15:51.366Z","etag":null,"topics":["dimensions","graphql","graphql-interface","metrics","olap"],"latest_commit_sha":null,"homepage":null,"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/bitquery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-22T12:46:01.000Z","updated_at":"2024-08-06T06:34:54.000Z","dependencies_parsed_at":"2023-02-16T13:45:56.109Z","dependency_job_id":null,"html_url":"https://github.com/bitquery/activecube-graphql","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitquery%2Factivecube-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitquery%2Factivecube-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitquery%2Factivecube-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitquery%2Factivecube-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitquery","download_url":"https://codeload.github.com/bitquery/activecube-graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253948504,"owners_count":21988961,"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":["dimensions","graphql","graphql-interface","metrics","olap"],"created_at":"2025-05-13T13:15:57.933Z","updated_at":"2025-05-13T13:16:00.703Z","avatar_url":"https://github.com/bitquery.png","language":"Ruby","readme":"# Activecube::Graphql\n\nThe gem simplifies building GraphQL interfaces to analytical databases (OLAP).\nFor OLAP queries we use [Activecube](https://github.com/bitquery/activecube) gem.\nGraphql is implemented by [Graphql](https://github.com/rmosolgo/graphql-ruby) gem.\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'activecube-graphql'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install activecube-graphql\n\n## Usage\n\n\n### Field mapping\n\nActivecube  must be mapped to a field using the following construct: \n\n```ruby\nfield_class Activecube::Graphql::CubeField\n\nfield :cube_name, [Response],  cube: CubeClass, null: true  do\n  # cube arguments go here...\nend\n```\n\nwhere:\n\n* **CubeClass** is the class of your Activecube ( typically defined in Models)\n* **Response** is the class for response. Typically it lists all possible metrics and dimensions\n\n**NOTE!** All fields that used as dimensions and metrics, MUST have an extra field 'ast_node' defined as:\n\n```ruby\n    field :field, Types::Dimension::Field, extras: [:ast_node], null: true do\n      argument :select, [FieldSelector], required: false\n    end\n```\n\n\n### Connection mapping\n\nIf you have multiple database connections for many cubes, it can be convinient to define the mapping \non the top level of GraphQL type:\n\n```ruby\n\nfield :connect, CubeFieldClass, null: false do\n  argument :database, Types::Enum::Databases, required: false\nend\n\ndef your_field method, *args\n  {\n      database: args[0]  ? args[0][:database].to_sym : method.to_sym\n  }\nend\n```\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/bitquery/activecube-graphql. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Activecube::Graphql project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/bitquery/activecube-graphql/blob/master/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitquery%2Factivecube-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitquery%2Factivecube-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitquery%2Factivecube-graphql/lists"}