Skip to content

Instantly share code, notes, and snippets.

View ShopifyEng's full-sized avatar

Shopify Engineering Communications ShopifyEng

View GitHub Profile
class Types::CustomerType < Types::BaseObject
implements GraphQL::Relay::Node.interface
def self.object_from_id(id, context)
CustomerRepository.find(context[:seller], id: id) # or: context[:seller].customers.find_by(id: id)
end
field :name, String, null: true
field :name, Email, null: true
# ...