Module: DiscoApp
- Defined in:
- app/clients/disco_app/graphql_client.rb,
lib/disco_app.rb,
lib/disco_app/engine.rb,
lib/disco_app/session.rb,
lib/disco_app/version.rb,
lib/disco_app/constants.rb,
lib/disco_app/configuration.rb,
app/clients/disco_app/api_client.rb,
app/models/disco_app/flow/action.rb,
app/models/disco_app/flow/trigger.rb,
app/models/disco_app/session_storage.rb,
app/models/disco_app/flow/trigger_usage.rb,
app/models/disco_app/flow/concerns/action.rb,
app/services/disco_app/flow/create_action.rb,
app/jobs/disco_app/flow/process_action_job.rb,
app/models/disco_app/flow/concerns/trigger.rb,
app/services/disco_app/flow/create_trigger.rb,
app/services/disco_app/flow/process_action.rb,
app/services/disco_app/partner_app_service.rb,
app/jobs/disco_app/concerns/shop_redact_job.rb,
app/jobs/disco_app/flow/process_trigger_job.rb,
app/services/disco_app/flow/process_trigger.rb,
app/models/disco_app/concerns/has_metafields.rb,
lib/generators/disco_app/react/react_generator.rb,
app/jobs/disco_app/concerns/customers_redact_job.rb,
app/models/disco_app/flow/concerns/trigger_usage.rb,
app/services/disco_app/flow/update_trigger_usage.rb,
app/controllers/disco_app/flow/actions_controller.rb,
lib/generators/disco_app/install/install_generator.rb,
app/services/disco_app/synchronise_resources_service.rb,
app/jobs/disco_app/concerns/customers_data_request_job.rb,
app/controllers/disco_app/flow/trigger_usage_controller.rb,
app/controllers/disco_app/flow/concerns/actions_controller.rb,
app/controllers/disco_app/flow/concerns/verifies_flow_payload.rb,
app/controllers/disco_app/flow/concerns/trigger_usage_controller.rb,
lib/generators/disco_app/react/templates/app/serializers/disco_app/shop_serializer.rb,
lib/generators/disco_app/react/templates/app/serializers/disco_app/user_serializer.rb
Overview
This file defines a very simple GraphQL API client to support a single type of GraphQL API call for a Shopify store - sending a Shopify Flow trigger.
We use this simple approach rather than using an existing GraphQL client library such as github.com/github/graphql-client (either standalone or as bundled with the Shopify API gem) for a couple of reasons:
- These libraries tend to presume that a single client instance is
instantiated once and then reused across the application, which isn't the
case when we're making API calls once per trigger for each background
job.
- These libraries make an API call to fetch the Shopify GraphQL schema on
initialisation. The schema is very large, so the API call takes a number
of seconds to complete and when parsed consumes a large amount of memory.
- These libraries do not natively work well with the idea of a dynamic API
endpoint (ie, changing the request URL frequently), which is required
when making many requests to different Shopify stores.
Defined Under Namespace
Modules: ApplicationHelper, Concerns, Flow, Generators, Test Classes: ApiClient, AppInstalledJob, AppSettings, AppUninstalledJob, ApplicationCharge, CarrierRequestService, ChargesController, ChargesService, Configuration, CustomersDataRequestJob, CustomersRedactJob, DiscoApiError, Engine, FrameController, GraphqlClient, InstallController, PartnerAppService, Plan, PlanCode, ProxyService, RecurringApplicationCharge, RenderAssetGroupJob, RequestValidationService, SendSubscriptionJob, Session, SessionStorage, Shop, ShopJob, ShopRedactJob, ShopSerializer, ShopUpdateJob, Source, Subscription, SubscriptionChangedJob, SubscriptionService, SubscriptionsController, SynchroniseCarrierServiceJob, SynchroniseResourcesJob, SynchroniseResourcesService, SynchroniseUsersJob, SynchroniseWebhooksJob, User, UserSerializer, UserSessionsController, WebhookService, WebhooksController
Constant Summary collapse
- VERSION =
'0.18.6'.freeze
- SOURCE_COOKIE_KEY =
'_disco_app_source'.freeze
- CODE_COOKIE_KEY =
'_disco_app_code'.freeze
Class Method Summary collapse
Class Method Details
.configuration ⇒ Object
40 41 42 |
# File 'lib/disco_app/configuration.rb', line 40 def self.configuration @configuration ||= Configuration.new end |
.configuration=(config) ⇒ Object
44 45 46 |
# File 'lib/disco_app/configuration.rb', line 44 def self.configuration=(config) @configuration = config end |
.configure {|configuration| ... } ⇒ Object
48 49 50 |
# File 'lib/disco_app/configuration.rb', line 48 def self.configure yield configuration end |