Shopify / Shopify/shopify-api-ruby

Extract REST Resources into standalone Gem

Open
#1,194 4 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
1.1k
Forks
484
PR merge metrics
No merged PRs in 30d

Description

The REST resources have key roles as they provide an interface in interacting with every endpoint of the API as well as casting responses into objects with defined attributes and methods.

These files are all generated from an OpenAPI schema that, ironically, are not yet open to the public. Given how many files are generated across many different versions of the API, this surface area brings a large amount of bugs and the root causes are found upstream in processes the community doesn't have access to. We have immediate plans to move those schemas/logic into the open source sphere, but we'd also like to take this time to extract the resources into their own gem separate from this Gem.

Why extract these resources into their own gem

  1. Fewer breaking changes to the foundational authentication/client level gem.
  2. Encourage more customization. Many of our users were upset about the direction of removing ActiveModel from our resources. By uncoupling these files from the foundational API we open the community up to add features, create their own gems, and better customize their development experience without having to fork the core authentication/client logic of this root gem.
  3. Open up the path for similar GraphQL types / interfaces.

Gem Architecture

Gem Name Job
Shopify API (this gem) Obtain a session, clients for APIs (REST, GraphQL), error handling, webhook management
REST Resources Interfaces to the APIs. Response casting into defined objects with attributes/methods
Shopify App Build Shopify app using Rails conventions. Oauth, webhook processing, persistence, etc
App Template Template demonstrating how to use all these components in one starting boilerplate application

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the generated resources under lib/shopify_api/rest and the proposed gem architecture in this issue. Define the extraction boundary and how the standalone gem relates to the existing Shopify API gem; done means the REST resources are separated without losing their endpoint interfaces, response casting, or defined attributes and methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.