dpdconnect / magento2-shipping-graphql
DPD Connect - Magento2 Shipping GraphQL
1.0.0
2021-06-15 14:53 UTC
Requires
This package is auto-updated.
Last update: 2024-09-17 15:39:09 UTC
README
composer require dpdconnect/magento2-shipping-graphql
描述
此扩展为 dpdconnect/magento2-shipping 模块添加了 GraphQL 支持。
使用此扩展,您可以获取快递店并保存选定的快递店。以下查询类型和突变类型得到支持
查询类型: parcelshops
允许您通过邮政编码/国家或用户指定的文本搜索快递店。
查询类型: selectedParcelshop
返回报价中保存的快递店。
突变类型: setParcelshop
在报价中保存选定的快递店。
使用 GraphQL 查询的示例用法
通过邮政编码和国家获取快递店
query getDpdParcelshops($postcode: String, $countryId: String) { parcelshops(postcode: $postcode, countryId: $countryId) { items { parcelshop_id company street houseno zipcode city country latitude longitude opening_hours { open_morning open_afternoon close_morning close_afternoon weekday __typename } __typename } total_count __typename } }
保存选定的快递店
mutation saveParcelshop( $parcelshop_d: String! $company: String! $street: String! $houseno: String! $zipcode: String! $city: String! $country: String! ){ setParcelshop( parcelshop_id: $parcelshop_id, company: $company, street: $street, houseno: $houseno, zipcode: $zipcode, city: $city, country: $country ) }
在服务器端获取已保存的报价中的快递店
query getSelectedParcelshop( $cartId: String! ) { selectedParcelshop( cart_id: $cartId ) { parcelshop_id company street zipcode city country __typename } }