зеркало из https://github.com/microsoft/Graphir.git
Generic Type Method Used to Resolve Identifier Type Field
This commit is contained in:
Родитель
c990db5f26
Коммит
bd543e2f93
|
@ -74,7 +74,4 @@ public class DataTypeResolvers
|
|||
|
||||
public static ResourceReference? GetReferenceValue(DataType? data)
|
||||
=> data is not null && data.TypeName == "Reference" ? data as ResourceReference : null;
|
||||
|
||||
public static Identifier? GetIdentifierValue(DataType? data)
|
||||
=> data is not null && data.TypeName == "Identifier" ? data as Identifier : null;
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ public class CompositionRelatesToComponentType : ObjectType<RelatesToComponent>
|
|||
|
||||
descriptor.Field(x => x.Code);
|
||||
descriptor.Field("targetIdentifier").Type<IdentifierType>()
|
||||
.Resolve(ctx => DataTypeResolvers.GetIdentifierValue(ctx.Parent<RelatesToComponent>().Target));
|
||||
.Resolve(ctx => DataTypeResolvers.GetValue<Identifier>(ctx.Parent<RelatesToComponent>().Target));
|
||||
|
||||
descriptor.Field("targetReference")
|
||||
.Resolve(ctx => DataTypeResolvers.GetReferenceValue(ctx.Parent<RelatesToComponent>().Target))
|
||||
|
|
Загрузка…
Ссылка в новой задаче