Module: ActiveGraphql::Model
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/active_graphql/model.rb,
lib/active_graphql/model/configuration.rb,
lib/active_graphql/model/relation_proxy.rb,
lib/active_graphql/model/find_in_batches.rb,
lib/active_graphql/model/action_formatter.rb,
lib/active_graphql/model/build_or_relation.rb
Overview
Allows to have ActiveRecord-like models which comunicates with graphql endpoint instead of DB: class RemoteUser
include ActiveGraphql::Model
graphql_url('http://localhost:3001/graphql')
graphql_attributes :id, :full_name
end
Now you can do: RemoteUser.where(created_at { from: ‘2000-01-01’, to: ‘2010-01-01’ }) RemoteUser.all.for_each { |user| … } RemoteUser.where(…).count
Model expects that graphql has GraphqlRails CRUD actions with default naming (createRemoteUser, remoteUsers, etc.)
Defined Under Namespace
Classes: ActionFormatter, BuildOrRelation, Configuration, FindInBatches, RelationProxy