Skip to content

Define shopify REST and GQL endpoints as BaseModels  #28

Open
@Nathan-Nesbitt

Description

@Nathan-Nesbitt

Since the endpoints are already defined by Shopify, could we type them so we can easily change them?

For example this would be a way of querying the customer rest endpoint:

store.shoprequest(
        goodstatus=200,
        method='get',
        debug='Error',
        endpoint=f'/customers.json?fields=tags&ids={custid}',
    )

Could we instead change this so we have a way of passing in an object with the correct parameters?

endpoint = Customer(field=tags, ids=custid)

store.shoprequest(
  method='get',
  debug='Error',
  endpoint=endpoint
)

This would provide typing and validation, along with the ability to centralize how the REST API is structured allowing easy updates if variables change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions