I have site v7 that is using umbraco graphql package. I have doctype alert which I can get using query like:
{ content {
byUrl(url: "/alerts/test/") {
... on Alert {
_contentData {
name
},title
summary
}
}}}
I have grid page and that has a doctype grid editor property that is multi node tree picker that allows picking of alerts doctype.
My graphql query to get content of grid page works but the alert picker is blob of json.
I have written a graph resolver looks like:
public class AlertResolver:GraphQLValueResolver
{
public override Type GetGraphQLType(PublishedPropertyType propertyType)
{
return typeof(AlertModelType);
}
public override bool IsConverter(PublishedPropertyType propertyType)
{
return propertyType.PropertyEditorAlias == "alert";
}
}
public class AlertModelType: ObjectGraphType<JToken>
{
public AlertModelType()
{
Name = "Alert";
Field<NonNullGraphType<StringGraphType>>("title",resolve:context=>context.Source["title"]);
Field<NonNullGraphType<StringGraphType>>("summary",resolve:context=>context.Source["summary"]);
}
}
In the graphql api I cannot render that alert I do not see it in intellisense. Is it even possible to write a resolver for grid property?
How to get grid property in umbraco graphql
I have site v7 that is using umbraco graphql package. I have doctype alert which I can get using query like:
I have grid page and that has a doctype grid editor property that is multi node tree picker that allows picking of alerts doctype.
My graphql query to get content of grid page works but the alert picker is blob of json.
I have written a graph resolver looks like:
In the graphql api I cannot render that alert I do not see it in intellisense. Is it even possible to write a resolver for grid property?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.