Skip to content
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

Updating Article type definitions #653

Merged
merged 1 commit into from
Jun 30, 2024

Conversation

ryanbalsdon
Copy link
Contributor

This patch is updating Article type definitions to match the documentation on the Shopify Dev Portal. The largest change is the inclusion of a src and alt field on the image, which lets Shopify download an image on your behalf. The remaining fields of both create and update actions have been marked as optional too. The only required field listed in the documentation is the Article ID on updates.

Added fields to the image type

The REST API documentation has two examples for adding images, one with the existing base64 data as attachment (called "Create an article with a base64 encoded image") and another with the src and alt fields (called "Create an article with an image, which will be downloaded by Shopify"). The image definition from the second example is copied below.

article.image = {
  "src": "http://example.com/rails_logo.gif",
  "alt": "Rails logo"
};

I think this change was mentioned in an old issue too.

Marked all fields as optional

The REST API documentation lists only two fields as required: api_version and blog_id. Since the Blog ID is part of the URL (and obviously required for that) and the API Version comes through a header (and not even present in the examples given), I'm not sure why they bothered to list them.

Why not use the GraphQL API?

Unfortunately, the Article mutations are in the unstable graphql branch so they're at least a few months out from hitting a full release. Interestingly though, the GraphQL API documentation also marks none of the fields as required, so the intention here will probably continue.

…hopify Dev Portal. The largest change is the inclusion of a src and alt field on the image, which lets Shopify download an image on your behalf. The remaining fields of both create and update actions have been marked as optional too. The only required field listed in the documentation is the Article ID on updates.
@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 11ea4d1 on ryanbalsdon:update-article-type-definitions
into fd6d034 on MONEI:master.

@lpinca lpinca merged commit 137627e into MONEI:master Jun 30, 2024
9 checks passed
@lpinca
Copy link
Collaborator

lpinca commented Jun 30, 2024

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants