Skip to content

Extract REST Resources into standalone Gem #1194

Open

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions