Property 'EthAgovLpStakeContr' does not exist on type 'EthAgovLpStake'.ts(2339) - tsx

I am trying to implementing Contractwith "web3 js" but i am getting this error "Property 'EthAgovLpStakeContr' does not exist on type 'EthAgovLpStake'.ts(2339)" when defined type
please help me
my code
const {EthAgovLpStakeContr}:EthAgovLpStake = await StakingContract("contract address");
getting issue in above line.

Related

getting error while deleting user on quickblox

How to delete user on quickblox ? I am using javascript sdk.. QB.users.delete(userId,function(err, result){}); I am getting error :- Cannot read property 'external' of undefined
A user can delete himself from the platform using sample code below:
var userId = 1;
QB.users.delete(userId, function(error, result){
});
The error "Cannot read property 'external' of undefined" can mean that the provided id does not exist in the back-end.

Empty object with union type in graphQL

When I' using union type in my graphQL schema I use it typically like this:
const documentTypeDefs = gql`
union TestType = TypeExample1 | TypeExample2
type Document {
exampleKey: TestType
}
`
Then I resolve it like this:
TestType: {
__resolveType(obj) {
if(obj.property1) {
return 'TypeExample1';
}
if(obj.property2) {
return 'TypeExample2';
}
return null;
},
}
But sometimes I'm getting empty object in my resolving function (ie. obj is {}). I thought returning null or undefined will do the job but unfortunately I'm getting error:
"Abstract type ItemsType must resolve to an Object type at runtime for field Document.exampleKey with value {}, received \"{}\". Either the ItemsType type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function."
How can I resolve empty object then?
Thank you!
If an empty object is being passed to __resolveType, that means your field is resolving to an empty object. That means either the value being returned inside your resolver is an empty object, or else the Promise returned is resolving to one.
If you're working with a field that returns a List, it's also possible for just one of the items being returned to be an empty object. This is particularly likely when working with MongoDB if one of the documents you're getting is actually empty or at least missing the fields you've specified in your mongoose schema.

GetMatchingProductSample AMAZON API

Im try to Get Product details with GetMatchingProductSample.php
request param look correctly:
$request->setSellerId(MERCHANT_ID);
$request->setMarketplaceId(my ID);
$request->setASINList(my ASIN);
when i try to execute i receve always this error:
Fatal error: Call to a member function _toQueryParameterArray() on a non-object
I've look a method but i dont see any error
When i type request-> i have only these methods:
setASINlist
setSellerId
setMWSAuthToken
Finally i found a way to do a right call.
Obviously they lacked the parameters and if someone can serve this is the correct call:
$asins = array('B06Y16RL4W', 'B071DQ128D');
$request = new
MarketplaceWebServiceProducts_Model_GetMatchingProductRequest();
$asin_list = new MarketplaceWebServiceProducts_Model_ASINListType();
$request->setSellerId(MERCHANT_ID);
$request->setMarketplaceId(MARKETPLACE_ID);
$asin_list->setASIN($asins);
$request->setASINList($asin_list);

strongly typed data set throws CastException

When I run this code:
'Dim Tab As ActDS.ACTDataImportDataTable = CType(Session("WorkData"), ActDS).ACTDataImport'
I get this error:
'System.InvalidCastException was unhandled by user code. Message=Unable to cast object of type 'ACTDataImportDataTable' to type 'ActDS'.'
'ActDS' is a strongly type data set and 'ACTDataImportDataTable' is a member of the data set.
What am I doing wrong?
Red.
Judging from the error message Session("WorkData") already is of type ActDS.ACTDataImportDataTable. It looks like the line should just be:
Dim Tab As ActDS.ACTDataImportDataTable =
CType(Session("WorkData"), ActDS.ACTDataImportDataTable)

Set Pointer to Object in Parse

I keep running into the error when trying to set a pointer to another class object in Parse. What is the correct format to set the pointer from an objectID?
Error:
[Error]: invalid type for key RestaurantName, expected *Restaurant, but got string (Code: 111, Version: 1.6.1)
Code:
var uploadPhoto = PFObject(className:"FoodPhoto")
uploadPhoto.setObject("lZJJHkFmQl", forKey: "RestaurantName")
uploadPhoto["PhotoName"] = "title"
let imageFile = PFFile(name:"image.png", data:imageData)
uploadPhoto["PhotoUploaded"] = imageFile
uploadPhoto["Votes"] = 0
uploadPhoto.saveInBackgroundWithBlock {
(success: Bool, error: NSError!) -> Void in
if (success) {
// The object has been saved.
} else {
// There was a problem, check error.description
}
}
You can create a pointer with the
PFObject(withoutDataWithClassName: "your_class_name", objectId: "your_object_id")
function, and set that to the field.
You have an object id string and a pointer is a reference to an actual object. That object id represents, or rather uniquely identifies, the object, but you can't diectly create a pointer with it. You need to get the object associated with the id.
If you already have it, great, substitute it where you currently put the string.
If you don't, you need to get it by running a query. Technically you could pass the string object id in a different field and have cloud code query and set the pointer (which would be more efficient than querying from the device if you don't already have the object).