Skip to content

A static version of the Altair GraphQL Client, for Rails and ActionCable subscriptions.

License

Notifications You must be signed in to change notification settings

jejacks0n/altair-rails

Repository files navigation

Altair Rails - The Altair GraphQL Client for Rails

Gem Version MIT License Build Status Maintainability Test Coverage RubyGems

Altair Rails is a Rails engine that provides a mountable endpoint for the Altair GraphQL Client.

Download and Installation

Add this line to your Gemfile:

gem "altair-rails"

Or install the latest version with RubyGems:

gem install altair-rails

Source code can be downloaded as part of the project on GitHub:

Configuration

By default the Altair GraphQL Client is mounted at /altair. It can be configured by adding an initializer to your Rails application:

Altair::Rails.configure do |config|
  # Where you want to mount the engine in your application. If set to nil,
  # the engine will not be mounted automatically and it will need to be
  # mounted manually. E.g.: in your routes.rb file, adding:
  #   mount Altair::Rails::Engine => "/altair"`
  config.mount_at = "/altair"

  # The path to your GraphQL endpoint. This is used to set the endpointURL.
  config.graphql_path = "/graphql"

  # The path to your ActionCable endpoint. This is used to set the
  # subscriptionsEndpoint.
  config.action_cable_path = "/cable"

  # Any options you want to pass to AltairGraphQL.init(). For more details:
  # https://github.com/altair-graphql/altair/blob/f433ee1bf6c52c8639b6448fa7e0c31c6ad955d1/packages/altair-core/src/config.ts
  config.altair_options = {}
end

Similar Projects

I created this project after battling GraphQL subscriptions, and GraphiQLs lack of support for ActionCable.

That being said, there are still great projects worth checking out:

  • graphiql-rails - A Rails engine that provides a mountable endpoint for GraphiQL.

License

This project is released under the MIT license:

Copyright 2023 jejacks0n

Make Code Not War

forthebadge

About

A static version of the Altair GraphQL Client, for Rails and ActionCable subscriptions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages