Comments (4)
@nsweeting Another question is, how are we going to handle outdated/updated resource structs? Are we going to keep outdated structs around to support different versions? Would we namespace them then (that would probably mess with pattern matching though)?
from shopify.
@nsweeting I thought about the issue a little more, and I realized that using maps instead of structs would get rid of all problems and would also allow for a seamless graphql integration.
I absolutely love the key safety structs provide, so I would like to keep that even if we decided to ditch them for this library. So my idea would be to extract the structs into a different library, and make it an optional dependency. That would also enable you to require different versions of the shopify resources for different api versions. If someone needs to support version X, he could use version 1.x structs and the shopify library would be agnostic to versions other than specifying it in the url.
from shopify.
Yeah I've been thinking about providing bare maps for a while now. It also prevents issues with missing attributes.
I'm wondering how other libraries will be handling the versioning. The ruby library uses ActiveResource, so that is much more dynamic in nature. The shopify go library would be a bit more like how elixir works. Technically, we could just maintain both old and new attributes in the same struct. It really depends on how complicated shopify ends up making the difference in versions.
Not sure about the extraction of the structs. Actually using them in reference to responses would get pretty complicated.
Will need to think on this a bit more...
from shopify.
I like the idea of using maps or at least have the option to use a bare maps instead of structs. The scope of api changes is still unknown but updating/deprecating versioned structs on a rolling basis might become a maintenance issue. Using bare maps eliminates a lot of the questions around how manage versions. A developer can reference the Shopify Api docs for relevant fields.
Looking at the official ruby/python libs they now require a version when initializing a session, I think this lib could adopt that. Ideally there would also be a way to dynamically make calls to various versions. ie.
Shopify.Session.put_version/2
or even something like
Shopify.Product.find(session, id, api_version: 'unstable')
Shopify.Product.find(session, id, api_version: '2019-04')
That's my 2 cents. Hope that helps.
from shopify.
Related Issues (20)
- Is this project dead? HOT 1
- Set timeout for HTTPoison requests HOT 2
- More detailed documentation HOT 4
- Order fulfillment event is using the wrong resource parser HOT 1
- Add tests to validate structs
- Shop info should be dynamically configurable HOT 1
- ScripTags Not Working HOT 1
- cost missing from InventoryItem resource
- Getting resources that don't necessarily match Resources / NestedResource HOT 4
- OAuth flow in test mock adapter seems incomplete HOT 1
- Feature: Multipass support HOT 1
- [PriceRule] Missing field HOT 1
- [Multipass] Clear up API HOT 1
- Order resource is missing endpoints
- Support Shopify's new cursor-based pagination HOT 2
- Failing travis-ci checks
- How ready is it? All API calls? HOT 1
- Unhandled CaseClauseError from bug in Posion
- Problems With OAuth Flow using Explicit API Version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shopify.