Comments (6)
@robodoginc I just tried reading some product metafield with that method in my application and it's working. Can you provide source code or try to debug it yourself?
Also as additional debugging routine I personally use - is to make exact same calls in Postman (popular REST testing app) as you do with this library (essentially it's all that this library do - making API calls, but with very useful models).
from shopifysharp.
@oleksii-vynnychenko Below is the source code that is failing for testing.
var shopProductService = new ShopifyProductService(myShopifyUrl, shopAccessToken);
var shopMetaService = new ShopifyMetaFieldService(myShopifyUrl, shopAccessToken);
using (dbEntities db = new dbEntities())
{
foreach (SaleItemShopifyProduct oSaleItemShopifyProduct in db.SaleItemShopifyProducts)
{
var metafields = await shopMetaService.ListAsync(oSaleItemShopifyProduct.Id, "products");
foreach (SaleItemShopifyMetaField oSaleItemShopifyMetaField in oSaleItemShopifyProduct.SaleItemShopifyMetaFields)
{
long metaId = oSaleItemShopifyMetaField.Id;
var sMeta1 = await shopMetaService.GetAsync(metaId);
var sMeta = metafields.Where(q => q.Id == metaId).FirstOrDefault();
}
}
}
The code is looping through values stored in the database. When I load metafields (based upon the productId), it loads all related meta fields properly.
The metaId is the value returned from Shopify. The .GetAsync
for sMeta1
is null, but the same Id in the loaded list, it finds and returns the object sMeta
properly. I am using the same service for the MetaFields, therefore it should not be a connection issue, as other tasks through the same service (ListAsync
and UpdateAsync
are functioning properly, but GetAsync
returns null).
from shopifysharp.
Thanks for reporting this! I've been super busy over the past couple of weeks and haven't had a chance to look into this yet, but I'll get on it as soon as possible.
from shopifysharp.
@robodoginc Ah, sorry... you're right.
Problem, I guess is that response is not Metafield object, but {"metafield": <metafield object>}
so Json.NET can't deserialize it, so it returns null
.
from shopifysharp.
Turns out it was a problem right here, where the service was expecting "metafields": {...}"
but should have been "metafield"
. It wasn't caught by the tests because .GetAsync()
was the one metafield test that somehow wasn't in the metafield test playlist.
Thanks again for opening this issue. The fix should be available on Nuget with ShopifySharp v3.1.1.
from shopifysharp.
My apologies. I missed that when I submitted that service. Thanks for sorting it.
from shopifysharp.
Related Issues (20)
- Product Service ListAsync - Not Paging HOT 2
- Deprecated property delivery_category is being used HOT 2
- How to list order by product ? HOT 3
- API get checkout by token not working HOT 6
- Internal application stopped working HOT 2
- Order not coming in api HOT 2
- Adding Multiple Tracking Numbers with Fulfillment.TrackingNumbers HOT 3
- Add read_returns and write_returns to access scopes enums HOT 2
- Customer is not returned by graphql mutation HOT 2
- LeakyBucket does not release the Semaphore if a request fails or the task is canceled
- Missing Alt attribute in ArticleImage class
- HttpResponseMessage Response in RequestResult marked as Obsolete HOT 5
- Add support for IAsyncEnumerable on every service that supports ListAsync
- Add support for validating the timestamp with a default timeout period in `ShopifyRequestValidationUtility`
- IsValidShopDomainAsync should check if shopDomain is a valid uri before building the shop domain uri HOT 2
- Support for Meta Objects? HOT 6
- RefundLineItem SubTotalTaxSet - copypaste issue? HOT 1
- Feature: Generate methods based on .graphql files HOT 2
- OrderRiskService Deprecated / Obsolete HOT 2
- New 'current_quantity' field of order 'line_items'
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 shopifysharp.