Comments (3)
Hi @rogalmic
Could you add what version of UHeadless and Umbraco CMS you experience this error on. And any reproduction steps that might be helpful debugging the issue.
from nikcio.uheadless.
Hi @nikcio
UHeadless version:
<PackageReference Include="Nikcio.UHeadless" Version="3.0.2" />
It is hard for me to create a test app reproducing this, since i added this as a test to already existing 2 language umbraco app.
The graphql will return following error for "Umbraco.BlockList" elements:
"extensions": {
"message": "Exception has been thrown by the target of an invocation.",
"stackTrace": " at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)\r\n at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)\r\n at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)\r\n at Nikcio.UHeadless.Core.Reflection.Factories.DependencyReflectorFactory.GetReflectedType[T](Type typeToReflect, Object[] constructorRequiredParamerters)\r\n at lambda_method142(Closure , IPureResolverContext )\r\n at HotChocolate.Execution.Processing.Tasks.ResolverTaskFactory.<ResolveAndCompleteInline>g__TryExecute|4_0(Object& result, <>c__DisplayClass4_0& )"
}
To find the actual root cause, i created a custom PropertyMap @ PropertyMapOptions, which allowed to replace default handler with my own copy implementation of BasicBlockListModel. I found out that createPropertyValue.Culture
has proper culture string, but it is not used in GetValue call "key1 is null", which results in exception from original report.
Side questions:
- is there a way to trace also inner exceptions, since the graphql returned one does not provide useful info?
- maybe it is possible to replace already existing entry in PropertyMap @ PropertyMapOptions, since AddEditorMapping will only add handler if umbraco type handler is not there (hence i needed to add custom AddEditorMapping implementation to register my "Umbraco.BlockList" handler in place of default one):
public class PropertyMapExt : PropertyMap {
public override void AddEditorMapping<TType>(string editorName)
{
base.types.Remove(typeof(TType));
base.editorPropertyMap.Remove(editorName);
base.AddEditorMapping<TType>(editorName);
base.AddUsedType<TType>();
}
}
from nikcio.uheadless.
Hi @rogalmic,
It looks like a mistake that createPropertyValue.Culture
wasn't included in the getValue
call. I've included it now in v3.0.3/3.0.4 and in my testing, it doesn't make a difference for the query. But with a way to reproduce the error, I cannot be certain that the error is fixed by this change. Please try updating to the new version and see if the error is resolved.
Side questions:
Is there a way to trace also inner exceptions, since the graphql returned one does not provide useful info?
Right now there's no better way to trace the errors than in the GraphQL returned one. You're welcome to create a PR implementing some kind of logging or other way to return the errors to the developers.
A starting point might be here:
Here most errors on properties will go through I don't know if there's a great way to handle it here.
Maybe it is possible to replace already existing entry in PropertyMap @ PropertyMapOptions, since AddEditorMapping will only add handler if umbraco type handler is not there (hence i needed to add custom AddEditorMapping implementation to register my "Umbraco.BlockList" handler in place of default one):
I've fixed this in v3.0.4. Now custom mappings will overrule.
from nikcio.uheadless.
Related Issues (20)
- How to "hide" the GraphQL UI in production? HOT 1
- How to protect schema endpoints by "roles" or "member groups"? HOT 3
- How to query only own data? HOT 10
- Using GraphQL to query MarkdownEditor value HOT 2
- Preview HOT 2
- Adding custom basic types HOT 3
- Exception thrown when content picker value is node with unpublished parent HOT 4
- Querying all descendants of a node including nested descendants HOT 2
- Empty value when property is shared between cultures HOT 3
- Extend the existing content model not extending to children and parent nodes HOT 3
- Support Preview flag in ContentByContentTypeQuery HOT 4
- Extending BlockList blocks? HOT 7
- How do you write a query to pull back data for all properties? (Breaking Change 2.0 -> 3.0) HOT 1
- How to authorize data access with OAUTH or JWT? HOT 4
- How mean this? HOT 1
- How to access to the proprierty value? HOT 1
- Query Error with field Umbraco.Grid HOT 16
- Is't possibile to push data to the Umbraco or only read from it? HOT 1
- Error in Docs: Where is the file howToUseAExtendingPackage.md? HOT 1
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 nikcio.uheadless.