-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define shopify REST and GQL endpoints as BaseModels #28
Comments
Same with GQL but not with the endpoint, but rather the |
If we can get the openAPI spec file from Shopify, that's a good idea ... otherwise too complicated to maintain. |
@hillairet could we at least trim some of the data from the request URL? Because I would imagine that the API stays consistent enough to be able to at least provide an interface like this: store.shoprequest(
method=GET,
resource='customers',
params={
'fields': 'tags'
'ids': custid
}
) As really the object could just convert back to the original URL format behind the scenes if we don't want to go forward with the API data models. I think this is easier to understand and harder to screw up than what is going on than the string endpoint param |
This way, in the future if it is valuable, we could make a set of ENUMS for all of the possible endpoints? (This shouldn't be too bad, as there is not that many endpoints) store.shoprequest(
method=GET,
resource=CUSTOMER,
params={
'fields': 'tags'
'ids': custid
}
) |
It's all about the gain, i.e. what problem you solve, vs pain, i.e. keeping it up to date forever. |
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:
Could we instead change this so we have a way of passing in an object with the correct parameters?
This would provide typing and validation, along with the ability to centralize how the REST API is structured allowing easy updates if variables change.
The text was updated successfully, but these errors were encountered: