You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create loader classes to define how to fetch and map data from Shopify's GraphQL APIs:
73
+
Create loader classes to define how to fetch and map data from Shopify's GraphQL APIs. There are two approaches: the new **attribute-based approach** (recommended) and the legacy **manual fragment approach**.
74
+
75
+
#### Attribute-Based Approach (Recommended)
76
+
77
+
Use the new `attribute` method to define GraphQL fields with automatic type coercion and fragment generation:
The `where` method automatically converts Ruby conditions into Shopify's GraphQL query syntax and validates that the query fields are supported by Shopify.
223
+
137
224
## Associations
138
225
139
226
ActiveShopifyGraphQL provides ActiveRecord-like associations to define relationships between the Shopify native models and your own custom ones.
customer =Customer.find("gid://shopify/Customer/123456789")# or Customer.find(123456789)
171
258
172
259
# Access associated orders (lazy loaded)
173
260
customer.rewards
@@ -191,16 +278,19 @@ The associations automatically handle Shopify GID format conversion, extracting
191
278
192
279
## Next steps
193
280
194
-
-[] Support `Model.where(param: value)` proxying params to the GraphQL query attribute
281
+
-[x] Support `Model.where(param: value)` proxying params to the GraphQL query attribute
195
282
-[ ] Eager loading of GraphQL connections via `Customer.includes(:orders).find(id)` in a single GraphQL query
283
+
-[ ] Better error handling and retry mechanisms for GraphQL API calls
284
+
-[ ] Caching layer for frequently accessed data
285
+
-[ ] Support for GraphQL subscriptions
196
286
197
287
## Development
198
288
199
289
After 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.
200
290
201
291
## Contributing
202
292
203
-
Bug reports and pull requests are welcome on GitHub at https://github.com/team-cometeer/active_shopify_graphql.
293
+
Bug reports and pull requests are welcome on GitHub at https://github.com/nebulab/active_shopify_graphql.
0 commit comments